REST-APIs are based on HTTP
Designing REST APIs
- Use proper HTTP Status codes
- Use location Headers
- Keep in mind Idempotency to deal with repeated requests, eventually lock down resources
- Use Rate limiting - e. g. using Redis. Also, it is recommended to inform clients when they can send their next request (
Retry-AfterHeaders) - Consider starting with
/v1as the first version. - Document the API with OpenAPI or similar standards
When not to use REST
Common alternatives are: GraphQL and approaches such as gRPC. The latter shines for service-to-service communication.