{"id":1096,"date":"2018-06-20T13:57:17","date_gmt":"2018-06-20T05:57:17","guid":{"rendered":"https:\/\/www.xiaobo.li\/?p=1096"},"modified":"2018-06-20T13:59:21","modified_gmt":"2018-06-20T05:59:21","slug":"api-error-code","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/1096","title":{"rendered":"API Error Code"},"content":{"rendered":"<h1>API \u5e38\u7528\u72b6\u6001\u7801\u63cf\u8ff0<\/h1>\n<h3>1)\u00a0\u00a0\u00a0\u00a0 HTTP\u72b6\u6001\u7801\u8868<\/h3>\n<p>\u7ed3\u679c\u7801\u53c2\u7167http\u534f\u8bae\u72b6\u6001\u7801\u5236\u5b9a\uff0c\u4e0b\u8868\u72b6\u6001\u7801\u8868\u793a\u63a5\u53e3\u5fc5\u5b9a\u7528\u5230\uff0c\u5176\u5b83\u72b6\u6001\u7801\u8bf7\u53c2\u8003\u6807\u51c6HTTP\u72b6\u6001\u7801\u8868\u3002<\/p>\n<table width=\"567\">\n<tbody>\n<tr>\n<td width=\"66\">\u72b6\u6001\u7801<\/td>\n<td width=\"170\">\u72b6\u6001\u6d88\u606f<\/td>\n<td width=\"331\">\u542b\u4e49<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">200<\/td>\n<td width=\"170\">OK<\/td>\n<td width=\"331\">\u8bf7\u6c42<strong><u>\u6210\u529f<\/u><\/strong>\u53ef\u6309\u4e1a\u52a1\u89e3\u6790\u7ed3\u679c<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">400<\/td>\n<td width=\"170\">Bad request<\/p>\n<p>\uff08\u574f\u8bf7\u6c42\uff09<\/td>\n<td width=\"331\">\u8bf7\u6c42\u7684\u6570\u636e\u672a\u6309\u8981\u6c42\u63d0\u4f9b<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">401<\/td>\n<td width=\"170\">Unauthorized<\/p>\n<p>\uff08\u672a\u6388\u6743\uff09<\/td>\n<td width=\"331\">\u5ba2\u6237\u7aef\u672a\u6388\u6743\u6216\u6388\u6743\u65e0\u6548<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">403<\/td>\n<td width=\"170\">Forbidden<\/td>\n<td width=\"331\">\u670d\u52a1\u5668\u5df2\u7ecf\u7406\u89e3\u8bf7\u6c42\uff0c\u4f46\u662f\u62d2\u7edd\u6267\u884c\u5b83\u3002<\/p>\n<p>\u6b64\u65f6\u9700\u8981\u6839\u636e<strong>\u9519\u8bef\u7801\u8868<\/strong>\u67e5\u8be2\u5177\u4f53\u7684\u9519\u8bef\u539f\u56e0<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">404<\/td>\n<td width=\"170\">Not Found<\/p>\n<p>\uff08\u672a\u627e\u5230\uff09<\/td>\n<td width=\"331\">\u627e\u4e0d\u5230\u8d44\u6e90<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">500<\/td>\n<td width=\"170\">Server Error<\/p>\n<p>(\u670d\u52a1\u5668\u9519\u8bef)<\/td>\n<td width=\"331\">\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">503<\/td>\n<td width=\"170\">Service Unavailable<\/p>\n<p>\uff08\u670d\u52a1\u5668\u4e34\u65f6\u7ef4\u62a4\uff09<\/td>\n<td width=\"331\">\u670d\u52a1\u5668\u4e34\u65f6\u7ef4\u62a4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h3>2)\u00a0\u00a0\u00a0\u00a0 \u9519\u8bef\u7f16\u7801<\/h3>\n<p>\u5f53\u63a5\u53e3 HTTP Status \u72b6\u6001\u7801\u54cd\u5e94\u4e3a 403 \u65f6\uff0c\u8868\u793a\u5f53\u524d\u8bf7\u6c42\u7684\u4e1a\u52a1\u4e0d\u80fd\u6309\u8981\u6c42\u5b8c\u6210\uff0c\u54cd\u5e94\u4e0d\u80fd\u5b8c\u6210\u6b64\u8bf7\u6c42\u7684\u9519\u8bef\u63cf\u8ff0\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u9519\u8bef\u7801\u67e5\u9605 \u201c\u7cfb\u7edf\u7ea7\u9519\u8bef\u7f16\u7801\u8868\u201d \u4e0e \u201c\u4e1a\u52a1\u7ea7\u9519\u8bef\u7f16\u7801\u8868\u201d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u9519\u8bef\u8fd4\u56de\u503c\u683c\u5f0f\uff1a JSON<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"568\">{<\/p>\n<p>\"code\"\u00a0: \"105\",<\/p>\n<p>\"message\"\u00a0: \" IP requests out of rate limit\"<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>3)\u00a0\u00a0\u00a0\u00a0 \u7cfb\u7edf\u7ea7\u9519\u8bef\u7f16\u7801\u8868<\/h3>\n<p>\u7cfb\u7edf\u7ea7\u9519\u8bef\u7f16\u7801\u7531 1 \u2013 999 \uff0c\u4fdd\u7559\u4e3a\u901a\u7528\u7ea7\u4e1a\u52a1\u54cd\u5e94\uff0c\u4e0d\u5141\u8bb8\u4e1a\u52a1\u6a21\u5757\u5bf9\u5176\u8fdb\u884c\u4f7f\u7528\u3002<\/p>\n<table width=\"567\">\n<tbody>\n<tr>\n<td width=\"66\">\u9519\u8bef\u7801<\/td>\n<td width=\"501\">\u542b\u4e49<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">100<\/td>\n<td width=\"501\">Too many pending tasks, system is busy<\/p>\n<p>\u4efb\u52a1\u8fc7\u591a\uff0c\u7cfb\u7edf\u7e41\u5fd9<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">101<\/td>\n<td width=\"501\">Job expired<\/p>\n<p>\u4efb\u52a1\u8d85\u65f6<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">102<\/td>\n<td width=\"501\">Illegal request<\/p>\n<p>\u975e\u6cd5\u8bf7\u6c42<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">103<\/td>\n<td width=\"501\">Request api not found<\/p>\n<p>\u63a5\u53e3\u4e0d\u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">104<\/td>\n<td width=\"501\">HTTP method is not suported for this request<\/p>\n<p>\u8bf7\u6c42\u7684HTTP METHOD\u4e0d\u652f\u6301\uff0c\u662f\u5426\u9009\u62e9\u4e86\u6b63\u786e\u7684POST\/GET\u65b9\u5f0f<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">105<\/td>\n<td width=\"501\">IP requests out of rate limit<\/p>\n<p>IP\u8bf7\u6c42\u9891\u6b21\u8d85\u8fc7\u4e0a\u9650<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">106<\/td>\n<td width=\"501\">User requests out of rate limit<\/p>\n<p>\u7528\u6237\u5bf9\u8d44\u6e90\u7684\u8bf7\u6c42\u9891\u6b21\u8d85\u8fc7\u4e0a\u9650<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">\u2026<\/td>\n<td width=\"501\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">999<\/td>\n<td width=\"501\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>4)\u00a0\u00a0\u00a0\u00a0 \u4e1a\u52a1\u9519\u8bef\u7f16\u7801\u8868<\/h3>\n<p>\u4e1a\u52a1\u7ea7\u9519\u8bef\u7f16\u7801\u4e3a 1000 - 9999 \u8303\u56f4\uff0c\u5176\u4e2d\u524d\u4e24\u4f4d\u8868\u793a\u6a21\u5757\uff0c\u540e\u4e24\u4f4d\u8868\u793a\u5177\u4f53\u9519\u8bef\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u9519\u8bef\u4ee3\u78011001 \u7684\u89e3\u91ca\u8bf4\u660e<\/p>\n<table width=\"48%\">\n<tbody>\n<tr>\n<td width=\"48%\">10<\/td>\n<td width=\"51%\">01<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">\u670d\u52a1\u6a21\u5757\u4ee3\u7801<\/td>\n<td width=\"51%\">\u5177\u4f53\u9519\u8bef\u4ee3\u7801<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6a21\u5757<\/p>\n<table width=\"48%\">\n<tbody>\n<tr>\n<td width=\"48%\">10<\/td>\n<td width=\"51%\">\u8d26\u53f7<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">11<\/td>\n<td width=\"51%\">\u8ba2\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">12<\/td>\n<td width=\"51%\">\u9001\u8d27\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">13<\/td>\n<td width=\"51%\">\u51fa\u5e93\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">14<\/td>\n<td width=\"51%\">\u7269\u6d41\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">15<\/td>\n<td width=\"51%\">\u5165\u5e93\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">16<\/td>\n<td width=\"51%\">\u7ed3\u7b97\u5355<\/td>\n<\/tr>\n<tr>\n<td width=\"48%\">17<\/td>\n<td width=\"51%\">\u53d1\u7968<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table width=\"567\">\n<tbody>\n<tr>\n<td width=\"66\">\u9519\u8bef\u7801<\/td>\n<td width=\"501\">\u542b\u4e49<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1000<\/td>\n<td width=\"501\">\u8d26\u53f7\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1001<\/td>\n<td width=\"501\">\u8d26\u53f7\u88ab\u51bb\u7ed3<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1100<\/td>\n<td width=\"501\">\u8ba2\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1101<\/td>\n<td width=\"501\">\u8ba2\u5355\u4e0d\u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1102<\/td>\n<td width=\"501\">\u8ba2\u5355\u5f53\u524d\u72b6\u6001\u4e0d\u5141\u8bb8\u8fdb\u884c\u6b64\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1200<\/td>\n<td width=\"501\">\u9001\u8d27\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1300<\/td>\n<td width=\"501\">\u51fa\u5e93\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1400<\/td>\n<td width=\"501\">\u7269\u6d41\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1500<\/td>\n<td width=\"501\">\u5165\u5e93\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1600<\/td>\n<td width=\"501\">\u7ed3\u7b97\u5355\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">1700<\/td>\n<td width=\"501\">\u53d1\u7968\u95ee\u9898\uff0c\u5177\u4f53\u9519\u8bef\u539f\u56e0\u67e5\u9605message<\/td>\n<\/tr>\n<tr>\n<td width=\"66\">&nbsp;<\/td>\n<td width=\"501\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>API \u5e38\u7528\u72b6\u6001\u7801\u63cf\u8ff0 1)\u00a0\u00a0\u00a0\u00a0 HTTP\u72b6\u6001\u7801\u8868 \u7ed3\u679c\u7801\u53c2\u7167http\u534f\u8bae\u72b6 &hellip; <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/1096\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[283],"tags":[326],"class_list":["post-1096","post","type-post","status-publish","format-standard","hentry","category-technologys","tag-api"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=1096"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1096\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=1096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=1096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=1096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}