List of HTTP status codes

Each HTTP response carries a status code, which is a clear number that indicates information about how to process the request

The HTTP status code is the first line in the HTTP response, which is sent from the server to the client.

This list will be very useful if you are trying to find out why the server is sending a specific status code and understand its meaning, or if you are building a server and are browsing to find the perfect status code.

The status code is represented by 3 digits and a short description.

The first digit of the numberReaction group.

There are 5 groups:

  • 1xx: Informational response-indicates that the request has been received and understood
  • 2xx: Successful response-indicates that the operation requested by the customer has been received, understood and accepted
  • 3xx: Redirect-indicates that the client must take other measures to complete the request
  • 4xx: Client error-indicates that there is an error, which seems to be caused by the client
  • 5xx: Server Error-indicates that an error has occurred on the server

In the remaining articles, I have listed all the useful status codes.

(I deleted some technology-specific technologies, such as WebDAV and rarely used technologies)

Information response

status code description
100 continue The server has received the request header, and the client should continue to send the request body (in the case of a request that needs to send the body, such as a POST request). After the request is rejected due to inappropriate headers, sending a large request body to the server will be inefficient. For the server to check the request header, the client must send Expect: 100-continue as the header in its initial request, and receive a 100 Continue status code as a response before sending the body. If the client receives an error code, such as 403 (forbidden) or 405 (method not allowed), the body of the request should not be sent. The response 417 Expectation Failed indicates that the request should be repeated without the Expect header because it indicates that the server does not support expectations (for example, this is the case with HTTP/1.0 servers).
101 Exchange Protocol The client asks the server to switch the protocol, and the server has agreed to do so.See RFC 7231#6.2.2

Successful response

status code description
200 OK This is the standard response for a successful HTTP request.
Created 201 It is usually a response to a POST request. The request has been completed and a new resource has been created.
202 Accept The request has been accepted for processing. Regarding the actual processing and its results, there is no explanation. This may happen on a separate server, or it may be batched.
203 non-authoritative information The original server returned 200, and the conversion agent between the client and the server changed the payload
204 No Content The server successfully processed the request, but did not return any content.
205 Reset content The server successfully processed the request, but did not return any content. Similar to the 204 response, but the server requires the client to reset the document view (for example, to clear the form)
Part 206 Respond toRangeIf the request comes from the client, the server will send a partial response.See RFC 7233#4.1


status code description
301 Moved Permanently This request and all future requests should be directed to the given URI. Only used with GET/HEAD requests, and308 Permanent RedirectAll other methods.
302 found Resources are temporarily moved toLocationHeader. Only used with GET/HEAD requests, and307 Temporary RedirectAll other methods.
303View other After issuing a POST or PUT request, point toLocationThe header can be accessed using a new GET request.
304 not modified When the client uses the request headerIf-Modified-SinceorIf-None-Match, This response status code indicates that the resource has not been modified.
307 Temporary Redirect Similar to302Request, unless it is not allowed to change the HTTP method
308 Permanent Redirect Similar to301Request, unless it is not allowed to change the HTTP method

Customer error

status code description
400 wrong request Because a request error was generated on the client, the server was unable to process the request. Errors may include malformed requests, requests that are too large to be processed, or others.
401 Unauthorized Sent when authentication is required and the client is not authorized
403 Forbidden For various reasons, this resource is unavailable. If the reason is authentication, please select401 Unauthorizedstatus code.
404 not found The requested resource could not be found.
405 Method not allowed The resource cannot be used by this HTTP method, but it may be used with other resources.
406 unacceptable Client passedAcceptThe header, whose value is incompatible with the server.
407 proxy authentication required There is a proxy that requires authentication between the client and the server.
408 request timed out The server timed out waiting for the request.
409 Conflict Indicates that the request cannot be processed due to a conflict in the current state of the resource (for example, an edit conflict between multiple simultaneous updates).
410 go The resource is no longer available and will no longer be available. For example, a more powerful feature than 404 is that search engines interpret it as an indication to delete the resource from its index.
411 required length The client needs to add a Content-Length header to the request, which is required.
412 Precondition failed If the customer sentIf-Unmodified-SinceorIf-None-MatchThe header is requested, and the server cannot meet the condition.
413 payload is too large The request is larger than the request that the server is willing or able to handle.
414 URI is too long The provided URI is too long for the server to process.
415 Unsupported media type The requesting entity has a media type that the server or resource does not support.
416 Range Not Satisfied Customer requestRangeHeader, but the server cannot provide that part.
417 Expectation Failed The server cannot meet the following requirementsExpectRequest headers.
421 Bad Request The request is directed to a server that cannot generate a response (for example, due to connection reuse).
426 Upgrade required The client should switch to another protocol specified in the protocol, such as TLS/1.0UpgradeHeader field.
428 Prerequisites The server requires that the request contains aIf-MatchHeader.
429 too many requests The user has sent too many requests in a given time. Used for rate limiting.
431 Request header field is too large The request cannot be satisfied because one or more headers or the entire header set is too large.
451 unavailable due to legal reasons The resource is unavailable due to legal reasons

Server Error

status code description
500 internal server error Generic server error message, given when an unexpected situation is encountered and there is no other more specific message.
501 not implemented Either the server cannot recognize the request method, or it cannot satisfy the request.
502 Bad Gateway The server was acting as a gateway or proxy and received an invalid response from the upstream server.
503 service unavailable The server is currently temporarily unavailable (because it is overloaded or shut down for maintenance).
504 Gateway timeout The server acts as a gateway or proxy and did not receive a response from the upstream server in time.
505 HTTP version is not supported The server does not support the HTTP protocol version specified in the request.

More web tutorials: