一直记不住http常用的status code,最近思考可以这样想。http无非就是客户端和服务端之间请求嘛。结果么要么成功,要么失败。
- 成功了,可以提示信息 -- Informational 1xx,也可以具体的成功的code -- Successful 2xx
- 失败了,或者客户端错误 -- Client Error 4xx,或者服务端错误 -- Server Error 5xx
- 最后剩余一个,重定向 -- Redirection 3xx
生活和日常开发常常遇见的一些status code:
- 200 OK
一切正常
-
302 Found
-
404 Not Found
引用