知识卡片
状态码区分处理结果
HTTP 状态码向客户端说明请求处理结果:2xx 表示成功,3xx 表示资源位置变化,4xx 表示请求侧问题,5xx 表示服务处理错误;1xx 表示处理中。客户端可先按类别决定后续动作,再根据具体状态码判断细节。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 4 章《Principles of REST API design》(源文件:_epub-src/OEBPS/Text/04.htm)
- 结论依据:原文明确列出五组状态码的用途,并将状态码定义为服务端请求处理结果的信号。
- 原始内容:We use status codes to signal the result of processing a request in the server. ... 1xx group —Signals that an operation is in progress 2xx group —Signals that a request was successfully processed 3xx group —Signals that a resource has been moved to a new location 4xx group —Signals that something was wrong with the request 5xx group —Signals that there was an error while processing the request