HTTP status codes

A huge list of well-defined HTTP status codes exists. This list of commonly used status codes is useful for designing RESTful APIs and leveraging the semantics that are defined for clear communication between producers and consumers.

It is highly recommended to not return a HTTP 200 status for all requests and encode the success or failure of the request in the response body. Keep in mind that there will be a specific HTTP status code for each scenario. Returning the proper status code will indicate the exact behavior that occurred on the server side, which allows the consumer to understand what happened there. There are five high-level HTTP status code classes, as described in the following table:

High-level status code Class Description
1xx Informational Continues the process after receiving the request.
2xx Success The action was received, understood, and accepted successfully.
3xx Redirection Further action required to complete the request.
4xx Client Error The request contains bad syntax or cannot be fulfilled. Possible reasons include authentication/authorization.
5xx Server Error The server failed to fulfil the request.

 

The following sections describe the most commonly used HTTP status codes in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.143.4