API Server Response Status - dreamerslab/workspace GitHub Wiki
API Server Response Status
Please read the original http 1.1 header status code spec first.
ref:
- http status codes for beginners
- msdn
- amazon errors
- webdev
- 302 vs 303 vs 307
- 401 vs 403
- 409 vs 412
- no record found
Header Status Code
We can specified more details in the json response body status feild.
200 OK
- mostly for get request
201 Created
- data created.
204 No Content
- data deleted.
- record( in the database ) not found.
302 Found
- request redirect
304 Not Modified
- from cache
400 Bad Request
- validation err
- wrong param format. Ex. wrong _id format or too long.
- request param missing.
401 Unauthorized
- need to login
- user_id & password does not match.
- user_id & token does not match.
403 Forbidden
- user has no right to access the resource.
404 Not Found
- resource not found
409 Conflict
- duplicate data.
- validation error - required field should be unique. Ex. email is taken.
412 Precondition Failed
- request param missing for get only, # deprecated.
500 Internal Server Error
- some shit happened.