The status code is responsible for describing the return of the request when the client sends a request to the server. With the help of status codes, users can know whether the server side has handled the request normally or what errors have occurred, which is convenient for our interface docking and debugging. The following are common status codes.
Status code | why | instructions |
---|---|---|
100-199. | Information response | |
100 | Continue | Request received, client should continue |
101 | Switching Protocol | In response to client Upgrade listing protocols, the server is switching protocols |
102 | Processing | The server is processing the request and no response is available |
103 | Early Hints | With Link, the client should start preloading the resource before the server continues to respond |
200-299. | A successful response | |
200 | OK | The request succeeded, as seen in GET HEAD POST TRACE |
201 | Created | The request was successful and a new resource was created, as seen in POST PUT |
202 | Accepted | Request received, but no response |
203 | Non-Authoritative Information | The response has been modified by the proxy server |
204 | No Content | Request processed, no return, client does not update view |
205 | Reset Content | Request processed, no return, client should update view |
206 | Partial Content | Request processed, partial content returned, common in video on demand, segmented download, breakpoint continuation |
300-399. | redirect | |
300 | Multiple Choice | Provides a list of addresses for clients to select for redirection |
301 | Moved Permanently | Permanent redirection, cacheable by default, search engines should update links |
302 | Found | Temporary redirection, not cached by default, unless specified by display |
303 | See Other | Temporary redirection, must GET request |
304 | Not Modified | Unmodified, does not contain the response body |
307 | Temporary Redirect | Temporary redirection, not cached by default, does not change the request method or body unless specified by display |
308 | Permanent Redirect | Permanent redirection, cacheable by default, the search engine should update the link without changing the request method or request body |
400-499. | Client error | |
400 | Bad Request | Incorrect request semantics or parameters should not be repeated |
401 | Unauthorized | The request requires authentication or authentication failed |
403 | Forbidden | Refuse and do not repeat the request |
404 | Not Found | Not found, no cause |
405 | Method Not Allowed | Disallowed request methods and returns a list of allowed request methods |
406 | Not Acceptable | Unable to return response body based on request condition |
407 | Proxy Authentication Required | Requests are authenticated on the proxy server |
408 | Request Timeout | The request timeout |
409 | Conflict | The request conflicts, and the response should contain the reason for the conflict |
410 | Gone | The resource has been permanently removed |
411 | Length Required | Content-length must be added to the request header |
412 | Precondition Failed | Except for non-getPOST requests, if-unmodified-since or if-none-match specifies that a prerequisite cannot be met |
413 | Payload Too Large | Request body data size out of the server processing range |
414 | URI Too Long | If the URL or query string is too long, a POST request is required |
415 | Unsupported Media Type | The requested file type is not supported by the server |
416 | Range Not Satisfiable | Request header Range does not coincide with resource available Range |
417 | Expectation Failed | The server cannot meet the expected response set by the client through Expect |
421 | Misdirected RequestHTTP2 is returned when the link under Misdirected RequestHTTP2 cannot be reused | |
425 | Too Early | The request has replay attack risk |
426 | Upgrade Required | The client should rerequest according to the protocol list in the response header Upgrade |
428 | Precondition Required | No resources Match if-match |
429 | Too Many Requests | Request frequency exceeds the server limit |
431 | Request Header Fields Too Large | The request header field is too large |
451 | Unavailable For Legal Reasons | The resource is unavailable for legal reasons |
500-511. | Server response | |
500 | Internal Server Error | The server reported an error, usually a script error |
501 | Not Implemented | Request method not supported by server |
502 | Bad Gateway | The gateway is not responding, usually because the server environment is incorrectly configured |
503 | Service Unavailable | The server is temporarily unavailable. It is recommended to return retry-after and the search engine crawler should revisit the URL for a while |
504 | Gateway Timeout | The gateway times out, usually because the server is overloaded |
505 | HTTP Version Not Supported | The requested HTTP protocol version is not supported |
506 | Variant Also Negotiates | The internal server is incorrectly configured |
510 | Not Extended | HTTP extensions are not supported |
511 | Network Authentication Required | Requires authentication, common with public WIFI |