HTTP Status Codes
A quick introduction to HTTP Status Codes
- 1xx: (Informational responses)
- 100: Continue - Indicates that the server is ready or capable of receiving the request content
- 101: Switching Protocols -
- 2xx: (Successful responses)
- 200: OK - Request succeeded immediately. Standard successful requests where the payload is ready.
- 201: Created - Resource created immediately. Synchronous creation (e.g., instantly adding a row to a database).
- 202: Accepted - Request queued for later execution. Asynchronous creation/processing where the resource isn’t ready yet.
- 3xx (Redirection responses)
- 300: Multiple Choices - The request has more than one possible responses.
- 301: Moved Permanently - The requested resource has been permanently moved to the
URLin theLocationheader. - 302: Found - The requested resource has been temporarily moved to the
URLin theLocationheader. - 307: Temporary Redirect - The resource requested has been temporarily moved to the
URLin theLocationheader. - 308: Permanent Redirect - The requested resource has been permanently moved to the
URLgiven by theLocationheader.
- 4xx (Client error responses)
- 400: Bad Request - Client sends invalid request to server. E.g: invalid user data to create an user.
- 401: Unauthorized - When a request was not successful because it lacks valid authentication credentials for the requested resource.
- 403: Forbidden - When someone has insufficient permissions to a resource or action.
- 404: Not Found - Server cannot find the requested resource
- 405: Method Not Allowed - The server knows the request method, but the target resource doesn’t support this method.
- 408: Request Timeout - Implies that the server has decided to close the connection rather than continue waiting. May be due to network issues or latency
- 409: Conflict - E.g: when uploading a file that is older than the existing one on the server, resulting in a version control conflict.
- 429: Too Many Requests - When the client has sent too many requests in a given amount of time. This mechanism of asking the client to slow down the rate of requests is commonly called “rate limiting”.
- 5xx (Server error responses)
- 500: Internal Server Error - The server encountered an unexpected condition that prevented it from fulfilling the request.
- 501: Not Implemented - The server does not support the functionality required to fulfill the request.
- 502: Bad Gateway - A server was acting as a gateway or proxy and that it received an invalid response from the upstream server.
- 503: Service Unavailable - The server is not ready to handle the request.
- 504: Gateway Timeout - The server, while acting as a gateway or proxy, did not get a response in time from the upstream server in order to complete the request.
- 505: Http Version Not Supported - The HTTP version used in the request is not supported by the server.
- 507: Insufficient Storage - The server does not have enough available storage to successfully complete the request.