-
Notifications
You must be signed in to change notification settings - Fork 152
HTTP Status Codes
There are over 70 HTTP status codes. However we do not need to use them all. We must avoid using too few or using too many. On one end, the API will lose clarity and on the other, developers will have to go to Wikipedia all the time to find what statuses mean.
To give you an idea of how large API providers use HTTP status codes
- Google GData API: 10 different codes
- 200 201 304 400 401 403 404 409 410 500
- Netflix: 9 different codes
- 200 201 304 400 401 403 404 412 500
There are really only 4 possible outcomes in the interaction between an app and an API:
- Everything worked (success): 2xx codes
- No problem occurred but further action is required by the client (redirection): 3xx codes
- The application (client) did something wrong (client error): 4xx codes
- The API did something wrong (server error): 5xx codes
This project is distributed under the terms of the EUPL FOSS license
REST Resources Design Workflow
REST Resources Single items and collections
REST Resources Many to many Relations
REST Resources Relations expansion
HTTP Status Codes Success (2xx)
HTTP Status Codes Redirection (3xx)
HTTP Status Codes Client Error (4xx)
HTTP Status Codes Server Error (5xx)
Pagination Out of range/bounds
Long-running Operations Example
Concurrency vs Delete operation
Caching and conditional requests About
Caching and conditional requests Rules
Caching and conditional requests HTTP headers
Error handling Example with a single error
Error handling Example with multiple errors
Error handling Example with parameters
Error handling Example with additional metadata
Bulk operations HTTP status codes
Bulk operations Resources naming convention
Bulk operations Creation example
Bulk operations Update example
Bulk operations Create and update example
File upload Simple file upload
File upload Simple file upload example
File upload Complex file upload
File upload Complex file upload example
REST Security General recommendations
REST Security Insecure direct object references