0% found this document useful (0 votes)
9 views1 page

Understanding HTTP Status Codes in REST APIs

HTTP status codes in REST APIs indicate the outcome of a request and are categorized into five groups: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Errors), and 5xx (Server Errors). Each category includes specific codes that describe the status, such as 200 OK for success and 404 Not Found for client errors. Understanding these codes is essential for effective API communication and error handling.

Uploaded by

hetokiw350
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Understanding HTTP Status Codes in REST APIs

HTTP status codes in REST APIs indicate the outcome of a request and are categorized into five groups: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Errors), and 5xx (Server Errors). Each category includes specific codes that describe the status, such as 200 OK for success and 404 Not Found for client errors. Understanding these codes is essential for effective API communication and error handling.

Uploaded by

hetokiw350
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like