HTTP API implementation
quick guide
Request design
- Use resource name paths (nouns, not verbs)
- Use plural resource name paths
- Use only two base URL paths per resource: collection and element in
collection
- Use standard HTTP method verbs to operate on collections and
elements
- Use custom methods only for functionality that cannot be easily
expressed via the standard methods
- Use versioned paths
- Use idempotent POST and PUT methods
- Use a unique identifier with every request
- Use pagination with size and token query parameters
- Use a rate limiter
- Use size limiters and message validators
- Use a separate domain or sub-domain
Response design
- Use HTTP status codes
- Use descriptive error responses (do not include sensitive
information)
- Use alerting for 5xx errors
Timeline
Misc