In REST APIs, HTTP status codes indicate the outcome of a request.
They are categorized into
five groups:
1xx - Informational
These codes indicate that the request was received and is being processed.
100 Continue – The server has received the request headers and the client should
proceed.
101 Switching Protocols – The server is switching protocols as requested.
2xx - Success
These codes indicate that the request was successfully processed.
200 OK – The request was successful.
201 Created – A new resource was successfully created.
204 No Content – The request was successful, but there is no response body.
3xx - Redirection
These codes indicate that further action is needed.
301 Moved Permanently – The requested resource has been permanently moved.
302 Found – The resource is temporarily available at a different location.
304 Not Modified – The resource has not changed since the last request.
4xx - Client Errors
These codes indicate issues with the request.
400 Bad Request – The request is malformed or invalid.
401 Unauthorized – Authentication is required.
403 Forbidden – The client does not have permission to access the resource.
404 Not Found – The requested resource does not exist.
5xx - Server Errors
These codes indicate issues on the server side.
500 Internal Server Error – A generic error occurred on the server.
502 Bad Gateway – The server received an invalid response from an upstream server.
503 Service Unavailable – The server is temporarily unavailable.