资源元信息修改
Last updated
2023-07-14 13:42:31
{"value":"## **\u63cf\u8ff0**\n\n\u672c\u63a5\u53e3\u7528\u4e8e\u4fee\u6539\u6587\u4ef6\u7684 MIME \u7c7b\u578b\u4fe1\u606f\u3002\n\n\n\n\n\n## **\u8bf7\u6c42**\n\n**\u8bf7\u6c42\u8bed\u6cd5**\n\n```\nPOST \/chgm\/<EncodedEntryURI>\/mime\/<EncodedMimeType>\/x-qn-meta-<meta_key>\/<EncodedMetaValue>\/cond\/<Encodedcond> HTTP\/1.1\nHost: rs.qiniuapi.com\nContent-Type: application\/x-www-form-urlencoded\nX-Qiniu-Date: 20060102T150405Z\nAuthorization: Qiniu <AccessToken>\n```\n\n\u4f7f\u7528\u8bf4\u660e\uff1a\n\n- \u5f52\u6863\/\u6df1\u5ea6\u5f52\u6863\u5b58\u50a8\u6587\u4ef6\uff0c\u53ea\u6709\u89e3\u51bb\u72b6\u6001\u65f6\u53ef\u4ee5\u4fee\u6539 MIME \u7c7b\u578b\u4fe1\u606f\n\n\n\n**\u8bf7\u6c42\u53c2\u6570**\n\n| \u53c2\u6570\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| ---------------- | ---- | ------------------------------------------------------------ |\n| EncodedEntryURI | \u662f | \u6307\u5b9a\u6587\u4ef6\u4fe1\u606f\uff0c\u5177\u4f53\u8bf7\u53c2\u8003EncodedEntryURI |\n| EncodedMimeType | \u5426 | \u81ea\u5b9a\u4e49\u65b0\u7684 mimeType\uff0c\u9700\u8981\u7ecf\u8fc7 Base64 \u7f16\u7801\uff0c\u5177\u4f53\u8bf7\u53c2\u8003EncodedEntryURI `mimetype` \u547d\u540d\u89c4\u5219\uff1a - \u652f\u6301\u5305\u62ec\u5982\u4e0b\u5b57\u7b26\u96c6\uff1a`a-z`, `A-Z`, `0-9`, `.`, `+`, `\/`, `-`, `;`, `=`, `,`, `_`\u548c\u7a7a\u683c - \u6700\u5927\u957f\u5ea6\u4e3a 200 \u5b57\u8282 - `mimetype`\u4e3a\u7a7a\u8fd9\u91cc\u8ba4\u4e3a\u5408\u6cd5\uff0c\u56e0\u4e3a\u5982\u679c\u4e3a\u7a7a\u540e\u9762\u4f1a\u8fdb\u4e00\u6b65\u68c0\u6d4b\u5e76\u8bbe\u7f6e - `mimetype`\u53ef\u4ee5\u5305\u62ec\u7a7a\u683c\uff0c\u4f8b\u5982\uff1a`text\/plain`; `charset=iso-8859-1` - \u7981\u6b62\u8f6c\u4e49\uff0c\u5982 `%0A` \u8868\u793a `\\n`\uff0c\u6240\u4ee5\u7981\u6b62\u51fa\u73b0 `%` |\n| meta_key | \u5426 | \u81ea\u5b9a\u4e49\u65b0\u7684 meta_key \u547d\u540d\u89c4\u5219\uff1a - \u652f\u6301\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u51cf\u53f7\u7ec4\u6210 - \u6700\u5927\u957f\u5ea6\u9650\u5236 50 \u5b57\u8282 - \u5355\u4e2a\u6587\u4ef6 meta_key \u548c metaValue \u603b\u548c\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 1024 \u5b57\u8282 - \u53ef\u4ee5\u540c\u65f6\u4fee\u6539\u591a\u4e2a meta \u5b57\u6bb5 |\n| EncodedMetaValue | \u5426 | \u81ea\u5b9a\u4e49\u5143\u6570\u636e\u4fe1\u606f\uff0c\u9700\u8981\u7ecf\u8fc7 Base64 \u7f16\u7801\uff0c\u5177\u4f53\u8bf7\u53c2\u8003 EncodedEntryURI\u547d\u540d\u89c4\u5219\uff1a - metaValue \u89c4\u5219\u548c mimeType \u76f8\u540c - \u5355\u4e2a\u6587\u4ef6 meta_key \u548c metaValue \u603b\u548c\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 1024 \u5b57\u8282 - \u53ef\u4ee5\u540c\u65f6\u4fee\u6539\u591a\u4e2a meta \u5b57\u6bb5 |\n| Encodedcond | \u5426 | \u81ea\u5b9a\u4e49\u6761\u4ef6\u4fe1\u606f\uff0c\u9700\u8981\u7ecf\u8fc7 Base64 \u7f16\u7801\uff0c\u5177\u4f53\u8bf7\u53c2\u8003 EncodedEntryURI\u5f53\u524d\u652f\u6301\u8bbe\u7f6e hash\u3001mime\u3001fsize\u3001putTime \u6761\u4ef6\uff0c\u53ea\u6709\u6761\u4ef6\u5339\u914d\u624d\u4f1a\u6267\u884c\u4fee\u6539\u64cd\u4f5c cond \u652f\u6301 condKey1=condVal1&condKey2=condVal2 \u683c\u5f0f |\n\n\n\n\n\n**\u8bf7\u6c42\u5934**\n\n| \u5934\u90e8\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e | | |\n| :-------------- | :--------------- | :----------------------------------------------------------- | ------------------------------------------------------------ | ---- |\n| `Authorization` | \u662f | \u8be5\u53c2\u6570\u5e94\u4e25\u683c\u6309\u7167\u7ba1\u7406\u51ed\u8bc1\u683c\u5f0f\u8fdb\u884c\u586b\u5145\uff0c\u5426\u5219\u4f1a\u8fd4\u56de401\u9519\u8bef\u7801\u4e00\u4e2a\u5408\u6cd5\u7684Authorization\u503c\u5e94\u7c7b\u4f3c\u4e8e\uff1a`Qiniu QNJi_bYJlmO5LeY08FfoNj9w_r7...` | | |\n| | \u5176\u4ed6\u6709\u5173\u8be6\u7ec6\u4fe1\u606f | | \u8bf7\u67e5\u9605[\u516c\u5171\u8bf7\u6c42\u5934](https:\/\/portal.7oss-hk.cdncloud.com\/doc\/kodo\/api\/3924\/common-request-headers.html) | |\n\n\n\n\n\n**\u8bf7\u6c42\u5185\u5bb9**\n\n\u8be5\u8bf7\u6c42\u64cd\u4f5c\u7684\u8bf7\u6c42\u4f53\u4e3a\u7a7a\u3002\n\n\n\n\n\n## **\u54cd\u5e94**\n\n**\u54cd\u5e94\u8bed\u6cd5**\n\n```\nHTTP\/1.1 200 OK\nContent-Type: application\/json\nCache-Control: no-store\n```\n\n\n\n\n\n### **\u54cd\u5e94\u5934**\n\n| \u5934\u90e8\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| :----------- | :--- | :----------------------------------------------------------- |\n| Content-Type | \u662f | \u6b63\u5e38\u60c5\u51b5\u4e0b\u8be5\u503c\u5c06\u88ab\u8bbe\u4e3a `application\/json`\uff0c\u8868\u793a\u8fd4\u56de JSON \u683c\u5f0f\u7684\u6587\u672c\u4fe1\u606f\u3002 |\n| \u5176\u4ed6 | | \u5176\u5b83\u53ef\u80fd\u8fd4\u56de\u7684\u5934\u90e8\u4fe1\u606f\uff0c\u8bf7\u53c2\u8003\u516c\u5171\u54cd\u5e94\u5934 |\n\n\n\n### **\u54cd\u5e94\u5185\u5bb9**\n\n\u5982\u679c\u8bf7\u6c42\u6210\u529f\uff0c\u4e0d\u8fd4\u56de\u4efb\u4f55\u5185\u5bb9\u3002 \u5982\u679c\u8bf7\u6c42\u5931\u8d25\uff0c\u8fd4\u56de\u5305\u542b\u5982\u4e0b\u5185\u5bb9\u7684 JSON \u5b57\u7b26\u4e32\uff08\u5df2\u683c\u5f0f\u5316\uff0c\u4fbf\u4e8e\u9605\u8bfb\uff09\uff1a\n\n```\n{\n \"error\": \"<errMsg string>\",\n}\n```\n\n| \u5b57\u6bb5\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| :------- | :--- | :--------------------------- |\n| error | \u662f | \u4e0e HTTP \u72b6\u6001\u7801\u5bf9\u5e94\u7684\u6d88\u606f\u6587\u672c |\n\n\n\n\n\n### **\u54cd\u5e94\u72b6\u6001\u7801**\n\n| HTTP\u72b6\u6001\u7801 | \u542b\u4e49 |\n| :--------- | :----------------------------------------------------------- |\n| 200 | \u66f4\u6539\u6210\u529f |\n| 400 | \u8bf7\u6c42\u62a5\u6587\u683c\u5f0f\u9519\u8bef \u5f53`<EncodedEntryURI>`\u89e3\u6790\u5931\u8d25\uff0c\u8fd4\u56de`400 Bad Request {\"error\":\"invalid argument\"}` \u5f53`<EncodedEntryURI>`\u4e0d\u7b26\u5408UTF-8\u7f16\u7801\uff0c\u8fd4\u56de`400 Bad Request {\"error\":\"key must be utf8 encoding\"}` \u5f53`mimeType`\u4e0d\u5408\u6cd5\u65f6\uff0c\u8fd4\u56de`400 Bad Request {\"error\":\"Invalid mimeType\"}` |\n| 401 | \u7ba1\u7406\u51ed\u8bc1\u65e0\u6548 |\n| 403 | \u7981\u6b62\u64cd\u4f5c \u5f53\u5f52\u6863\u5b58\u50a8\u6587\u4ef6\u672a\u89e3\u51bb\u5b8c\u6210\u8c03\u7528\u63a5\u53e3\u4f1a\u8fd4\u56de`403 ArchiveUnrestored {\"error\":\"archive unrestored\"}` \u5f53\u6df1\u5ea6\u5f52\u6863\u5b58\u50a8\u6587\u4ef6\u672a\u89e3\u51bb\u5b8c\u6210\u8c03\u7528\u63a5\u53e3\u4f1a\u8fd4\u56de`403 DeepArchiveUnrestored {\"error\":\"deep archive unrestored\"}` |\n| 612 | \u76ee\u6807\u8d44\u6e90\u4e0d\u5b58\u5728 |\n| 613 | \u5f53`cond`\u6761\u4ef6\u4e0d\u6ee1\u8db3\u65f6\uff0c\u8fd4\u56de`613 {\"error\": \"cond not match\"}` |\n| 599 | \u670d\u52a1\u7aef\u64cd\u4f5c\u5931\u8d25 |\n| \u5176\u4ed6\u9519\u8bef\u7801 | \u8bf7\u67e5\u9605\u9519\u8bef\u54cd\u5e94 |\n\n\u5982\u9047 599 \u9519\u8bef\uff0c\u8bf7\u5c06\u5b8c\u6574\u9519\u8bef\u4fe1\u606f\uff08\u5305\u62ec\u6240\u6709 HTTP \u54cd\u5e94\u5934\u90e8\uff09\u63d0\u4ea4\u5de5\u5355\u7ed9\u6211\u4eec\u3002\n\n\n\n## **\u793a\u4f8b**\n\n**\u8bf7\u6c42\u793a\u4f8b**\n\n```\nPOST \/chgm\/YnVja2V0OmtleQ==\/x-qn-meta-meta_key\/bWV0YV92YWx1ZQ==\/cond\/ZnNpemU9Ng== HTTP\/1.1\nHost: rs.qiniuapi.com\nUser-Agent: Go-http-client\/1.1\nContent-Length: 0\nAuthorization: Qiniu EmEtww5prO5pe8ts_mG.......1tXlEQ9hoG4:LuGCwpfK-rM=\nX-Qiniu-Date: 20060102T150405Z\nContent-Type: application\/x-www-form-urlencoded\nAccept-Encoding: gzip\n```\n\n*\u6ce8\uff1a\u8981\u5728 `Authorization` \u5934\u90e8\u7684 `<AccessToken>` \u524d\u6dfb\u52a0 `Qiniu` \u548c\u534a\u89d2\u7a7a\u683c\u3002*\n\n**\u54cd\u5e94\u793a\u4f8b**\n\n```\nHTTP\/1.1 200 OK\nServer: nginx\nDate: Mon, 02 Jan 2006 15:04:05 GMT\nContent-Type: application\/json\nContent-Length: 0\nConnection: keep-alive\nX-Reqid: -nIAABnfaeIlucoU\n```"}