0
Vote

Return Appropriate HTTP Codes

description

2XX - SUCCESS CODES

200 - Response Accepted
201 - Resource created (for a PUT)
 

3XX - REDIRECT CODES

302 - Temporary Redirect (could be used to point the client to the current version of a resource)
 

4XX - CLIENT PROBLEM CODES

400 - Bad Request (invalid posted fields)
401 - Unauthorized
405 - Method Not Allowed (when the client requests a GET/POST/PUT/DELETE that is not allowed on that URI)
408 - Request Timeout
409 - Conflict (this would be used if the user posted a version of an object but the version in the database has already been incremented)
410 - Gone (in a PUT command if the resource is not there)
415 - Unsupported Media Type
 

5XX - SERVER PROBLEM CODES

500 - Internal Server Error

comments