Thursday, December 19, 2019

REST Services: HTTP Status Codes


HTTP defines forty standard status codes that can be used to convey the results of a client’s request. The status codes are divided into the five categories presented below.

CATEGORY                                                   DESCRIPTION
1xx: Informational           Communicates transfer protocol-level information.
2xx: Success                  Indicates that the client’s request was accepted successfully.
3xx: Redirection              Indicates that the client must take some additional action in order to complete their request.
4xx: Client Error             This category of error status codes points the finger at clients.
5xx: Server Error            The server takes responsibility for these error status codes.

200
OK
201
Created
204
No content
301
Moved Permanently
302
Found
303
See Other
304
Not Modified
307
Temporary redirect
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
405
Method not allowed
406
Not acceptable
412
Precondition Failed
415
Unsupported Media Type
500
Internal Server Error
501
Not Implemented
503
Service Unavailable
504
Gateway timeout