{"id":78256,"date":"2024-01-03T06:16:38","date_gmt":"2024-01-02T22:16:38","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=78256"},"modified":"2024-01-03T06:16:38","modified_gmt":"2024-01-02T22:16:38","slug":"ljhztmdhy","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/78256.html","title":{"rendered":"\u4e86\u89e3422 HTTP\u72b6\u6001\u7801\u7684\u542b\u4e49"},"content":{"rendered":"
\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u4e86\u89e3HTTP\u534f\u8bae\u4e2d\u7684\u72b6\u6001\u7801422\u7684\u542b\u4e49\uff0c\u63a2\u8ba8\u5176\u5728\u7f51\u7edc\u901a\u4fe1\u4e2d\u7684\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n
HTTP\u72b6\u6001\u7801422 – Unprocessable Entity\uff0c\u610f\u4e3a\u201c\u65e0\u6cd5\u5904\u7406\u7684\u5b9e\u4f53\u201d\uff0c\u662f\u4e00\u79cd\u8868\u793a\u670d\u52a1\u5668\u7406\u89e3\u4e86\u8bf7\u6c42\uff0c\u4f46\u662f\u65e0\u6cd5\u5904\u7406\u7684\u72b6\u6001\u7801\u3002\u901a\u5e38\u5728\u5904\u7406\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u6570\u636e\u65f6\u53d1\u751f\u9519\u8bef\u65f6\u4f7f\u7528\uff0c\u63d0\u4f9b\u4e86\u66f4\u5177\u4f53\u7684\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n
422\u72b6\u6001\u7801\u901a\u5e38\u7528\u4e8e\u8868\u5355\u63d0\u4ea4\u7b49\u573a\u666f\uff0c\u7528\u4e8e\u901a\u77e5\u5ba2\u6237\u7aef\u5176\u63d0\u4ea4\u7684\u6570\u636e\u6709\u8bef\u3002\u8fd9\u6709\u52a9\u4e8e\u5ba2\u6237\u7aef\u66f4\u597d\u5730\u7406\u89e3\u51fa\u73b0\u7684\u95ee\u9898\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u8c03\u6574\u548c\u4fee\u6b63\u3002<\/p>\n
\u5728Web\u5f00\u53d1\u4e2d\uff0c\u6570\u636e\u9a8c\u8bc1\u662f\u4e00\u9879\u91cd\u8981\u7684\u5de5\u4f5c\u3002\u901a\u8fc7422\u72b6\u6001\u7801\uff0c\u670d\u52a1\u5668\u53ef\u4ee5\u5411\u5ba2\u6237\u7aef\u4f20\u8fbe\u6570\u636e\u9a8c\u8bc1\u5931\u8d25\u7684\u6d88\u606f\uff0c\u5176\u4e2d\u5305\u62ec\u5177\u4f53\u7684\u9519\u8bef\u7c7b\u578b\u548c\u4f4d\u7f6e\uff0c\u5e2e\u52a9\u5ba2\u6237\u7aef\u66f4\u52a0\u51c6\u786e\u5730\u4fee\u6b63\u9519\u8bef\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n
\u8bb8\u591a\u73b0\u4ee3Web\u5e94\u7528\u7a0b\u5e8f\u5728\u6570\u636e\u63d0\u4ea4\u548c\u5904\u7406\u8fc7\u7a0b\u4e2d\u5e7f\u6cdb\u4f7f\u7528422\u72b6\u6001\u7801\u3002\u5b83\u4e0d\u4ec5\u5e2e\u52a9\u7528\u6237\u66f4\u5feb\u5730\u53d1\u73b0\u9519\u8bef\uff0c\u4e5f\u63d0\u9ad8\u4e86\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u51c6\u786e\u6027\u3002<\/p>\n
\u5728Web\u8868\u5355\u63d0\u4ea4\u8fc7\u7a0b\u4e2d\uff0c422\u72b6\u6001\u7801\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u66f4\u5feb\u5730\u53d1\u73b0\u5e76\u4fee\u6b63\u9519\u8bef\uff0c\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\u3002\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8d77\u4f7f\u7528\u901a\u7528\u7684\u9519\u8bef\u72b6\u6001\u7801\u5982400\u66f4\u7b26\u5408RESTful\u8bbe\u8ba1\u539f\u5219\u3002<\/p>\n
\u5728API\u5f00\u53d1\u4e2d\uff0c\u4f7f\u7528422\u72b6\u6001\u7801\u53ef\u4ee5\u5e2e\u52a9\u5ba2\u6237\u7aef\u66f4\u597d\u5730\u5904\u7406\u6570\u636e\u9a8c\u8bc1\u5931\u8d25\u7684\u60c5\u51b5\uff0c\u6709\u6548\u5730\u51cf\u5c11\u4e86\u4e0d\u5fc5\u8981\u7684\u901a\u4fe1\u548c\u6570\u636e\u4f20\u8f93\uff0c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u6027\u80fd\u548c\u6548\u7387\u3002<\/p>\n
\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u4e86\u89e3\u4e86HTTP\u72b6\u6001\u7801422\u7684\u542b\u4e49\u53ca\u5176\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u91cd\u8981\u4f5c\u7528\u3002<\/strong>\u5bf9\u4e8e\u6570\u636e\u9a8c\u8bc1\u548c\u9519\u8bef\u5904\u7406\uff0c422\u72b6\u6001\u7801\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u66f4\u52a0\u7cbe\u51c6\u548c\u6709\u6548\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6784\u5efa\u66f4\u52a0\u5065\u58ee\u548c\u53ef\u9760\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u4e86\u89e3HTTP\u534f\u8bae\u4e2d\u7684\u72b6\u6001\u7801422\u7684\u542b\u4e49\uff0c\u63a2\u8ba8\u5176\u5728\u7f51\u7edc\u901a\u4fe1\u4e2d\u7684\u91cd\u8981\u4f5c\u7528\u3002422\u72b6\u6001\u7801\u7684\u4f5c\u7528HTTP\u72b6\u6001\u7801422-Unprocessable<\/p>\n","protected":false},"author":1,"featured_media":64183,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[259],"class_list":["post-78256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-rs422"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/78256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=78256"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/78256\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64183"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=78256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=78256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=78256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}