What are a few common HTTP Status Codes and what do they mean?
HTTP responses can be classified into 5 categories:
1xx— Informational Response, means that the request was received by the server and is an indication to the client to wait for the final response.
2xx — Success or Acceptance Response, indicates that the request was successfully received and accepted by the server
3xx — Redirection Response, informs the client that the request has been redirected to another server and the client needs to take explicit action to complete the request
4xx — Client Error Response, indicates that the request sent by the client contains some error
5xx — Server Error Response, indicates that the server received the client request but the request wasn’t completed due to an error on the server-side
A few commonly used status codes
Below is a list of HTTP status codes that I personally see very commonly.
- 200: OK — the request has succeeded
- 202: Accepted — indicates that the request has been received and is being processed.
- 204: No Content — the request has been completed but there is no content to be sent to the client for this request
- 301: Moved Permanently — indicates that the resource has been permanently moved to a new URL. The new URL is returned as a part of the response header
- 302: Found — indicates that the resource has been temporarily moved to a new URL. The new URL is returned as a part of the response header
- 400: Bad Request —is a generic error code that indicates that request will not be processed by the server because it contains a client error
- 401: Unauthorized — indicates that the request will not be processed since the client does not have authorized access to the target resource
- 403: Forbidden — indicates that the request will not be processed by the server because it is forbidden due to some client error
- 404: Not Found — indicates that the server cannot find the resource requested by the client
- 405: Method Not Allowed — indicates that the server received the request and recognizes the method but refused to process it
- 408: Request Timeout — indicates that the server did not receive the complete request from a client within a set time period and wants to close the connection
- 500: Internal Server Error — is a generic server error indicating that something went wrong on the server-side and the server is unable to fulfill the request
- 501: Not Implemented — indicates that the server does not recognize the requested feature and is unable to process the request
- 502: Bad Gateway — indicates that the gateway server received an error response from another upstream server
- 503: Service Unavailable — indicates that the server is temporarily unavailable to handle the request
- 504: Gateway Timeout — indicates that the gateway server did not receive a response from another upstream server within the timeout period
References: