What are Response Codes in Web API?

This are response codes in web API

1xx: Informational – Communicates transfer protocol-level information.

2xx: Success – Indicates that the client’s request was accepted successfully.

3xx: Redirection – This means request is not complete. The client must take some additional action in order to complete their request.

4xx: Client Error – This means there is some error in API code.

5xx: Server Error – This means the error is not due to web api code but due to some environment settings. 

200 OK: The request was successful, and the server has returned the requested data in the response body.

204 No Content: The request was successful, but the server has no data to return in the response body.

400 Bad Request: The client's request was invalid or could not be understood by the server.

401 Unauthorized: The client is not authorized to access the requested resource. The client should include authentication credentials in the request header to authenticate itself.

403 Forbidden:
The client is authenticated, but not authorized to access the requested resource.

404 Not Found: The requested resource could not be found on the server.

500 Internal Server Error: An error occurred on the server while processing the request.

Post a Comment

Previous Post Next Post