Friday, 22 April 2016

Which HTTP error codes can be used by REST API ?


OK
 HTTP codes
200 = Success
201 = Success : New resource created
204 = Success : Resource deleted


KO HTTP codes
304 = Not Modified : Client uses cached data
400 = Bad request : Invalid request; Cannot be served; Details in the error payload like, JSON resposne
401 = Unauthorized : Request requires user authentication
403 = Forbidden Access to requested resource is not permitted
404 = Not found : Resource not found for given URI
422 = Unprocessable : Server cannot process the entity
500 = Internal Server Error : Should not be thrown or returned from the API

No comments:

Post a Comment

Note: only a member of this blog may post a comment.