YouTip LogoYouTip

Http Status Codes

HTTP Status Codes | Novice Tutorial

When a visitor accesses a web page, the visitor's browser sends a request to the server where the web page is located. Before the browser receives and displays the web page, the server where the web page is located will return an information header (server header) containing an HTTP status code to respond to the browser's request.

The English term for HTTP status codes is HTTP Status Code.

Below are common HTTP status codes:

  • 1xx (Informational Status Codes): Indicates that the received request is being processed.
  • 2xx (Success Status Codes): Indicates that the request was processed normally.
  • 3xx (Redirection Status Codes): Requires subsequent operations to complete this request.
  • 4xx (Client Error Status Codes): Indicates that the request contains syntax errors or cannot be completed.
  • 5xx (Server Error Status Codes): The server encountered an error during the process of handling the request.

HTTP Status Code Classification

HTTP status codes consist of three decimal digits, with the first decimal digit defining the type of status code. Responses are divided into five categories: informational responses (100–199), successful responses (200–299), redirections (300–399), client errors (400–499), and server errors (500–599):

Classification Classification Description
1** Information, server received request, requires requester to continue executing operation
2** Success, operation successfully received and processed
3** Redirection, further operations needed to complete request
4** Client error, request contains syntax errors or cannot complete request
5** Server error, server encountered error during processing of request

HTTP status code list:

Status Code Status Code English Name Chinese Description
100 Continue Continue. Client should continue its request
101 Switching Protocols Switch protocols. Server switches protocols according to client's request. Can only switch to higher-level protocols, for example, switching to new version of HTTP protocol
200 OK Request successful. Generally used for GET and POST requests
201 Created Created. Successfully requested and created new resource
202 Accepted Accepted. Request has been accepted but not yet fully processed
203 Non-Authoritative Information Non-authoritative information. Request successful. But returned meta information is not from original server, but from a copy
204 No Content No content. Server successfully processed but returned no content. When webpage is not updated, can ensure browser continues displaying current document
205 Reset Content Reset content. Server processed successfully, user terminal (for example: browser) should reset document view. Can clear browser form fields through this return code
206 Partial Content Partial content. Server successfully processed partial GET request
300 Multiple Choices Multiple choices. Requested resource may include multiple locations, response may return a list of resource characteristics and addresses for user terminal (for example: browser) selection
301 Moved Permanently Permanently moved. Requested resource has been permanently moved to new URI, returned information will include new URI, browser will automatically redirect to new URI. Any future new requests should use new URI instead
302 Found Temporarily moved. Similar to 301. But resource is only temporarily moved. Client should continue using original URI
303 See Other See other address. Similar to 301. Use GET and POST requests to view
304 Not Modified Not modified. Requested resource not modified, when server returns this status code, no resource is returned. Client typically caches accessed resources, by providing header information indicating that client only wants resources modified after specified date
305 Use Proxy Use proxy. Requested resource must be accessed through proxy
306 Unused Deprecated HTTP status code
307 Temporary Redirect Temporary redirect. Similar to 302. Use GET request for redirection
400 Bad Request Client request has syntax error, server cannot understand
401 Unauthorized Request requires user authentication
402 Payment Required Reserved for future use
403 Forbidden Server understands client request but refuses to execute this request
404 Not Found Server cannot find resource (webpage) according to client request. Through this code, website designers can set up "resource you requested cannot be found" custom pages
405 Method Not Allowed Method in client request is forbidden
406 Not Acceptable Server cannot complete request according to content characteristics requested by client
407 Proxy Authentication Required Request requires proxy authentication, similar to 401, but requester should use proxy for authorization
408 Request Time-out Server waited too long for client to send request, timeout
409 Conflict Server may return this code when completing client's PUT request, server encountered conflict while processing request
410 Gone Resource requested by client no longer exists. 410 differs from 404, if resource existed before but now permanently deleted, 410 code can be used, website designers can specify new location of resource through 301 code
411 Length Required Server cannot process client request without Content-Length
412 Precondition Failed Client request information precondition error
413 Request Entity Too Large Due to request entity being too large, server cannot process, therefore rejects request. To prevent continuous client requests, server may close connection. If server is temporarily unable to process, response may include Retry-After information
414 Request-URI Too Large Requested URI too long (URI usually URL), server cannot process
415 Unsupported Media Type Server cannot process media format attached to request
416 Requested range not satisfiable Range requested by client is invalid
417 Expectation Failed(expected failureοΌ‰ Server cannot satisfy expected behavior specified in Expect field of request header.
418 I'm a teapot Status code 418 is actually an April Fools' joke. It is defined in RFC 2324, which is a joke document about Hyper Text Coffee Pot Control Protocol (HTCPCP). In this joke, status code 418 was added to HTTP protocol as a joke.
500 Internal Server Error Server internal error, cannot complete request
501 Not Implemented Server does not support requested function, cannot complete request
502 Bad Gateway Gateway or proxy server attempting to execute request received invalid response from remote server
503 Service Unavailable Due to overload or system maintenance, server temporarily unable to process client request. Delay length may be included in server's Retry-After header information
504 Gateway Time-out Gateway or proxy server did not receive request from remote server in time
505 HTTP Version not supported Server does not support version of HTTP protocol in request, cannot complete processing
← Python FunctionsHttp Header Fields β†’