Best Practices for designing a Restful API
1. API resource name should be plural noun and not any verb.
example: /customers
2. Use SSL certificate for APIs for security. In SSL, HTTPS protocol is used instead of HTTP.
3. Use of RAML for API specification and documentation.
4. Versioning of API should be done so that we should aware of changes done in APIs.
5. use of query parameters and URI parameters for filtering data.
6. Use of server status codes like 200 for success and 500 for internal server error.
7. Use JSON for API response.
8. Use camel case in field names.
9. Should have a suitable exception handling mechanism.
10. API Should have proper security mechanism like authentication,rate limiting,etc.
1. API resource name should be plural noun and not any verb.
example: /customers
2. Use SSL certificate for APIs for security. In SSL, HTTPS protocol is used instead of HTTP.
3. Use of RAML for API specification and documentation.
4. Versioning of API should be done so that we should aware of changes done in APIs.
5. use of query parameters and URI parameters for filtering data.
6. Use of server status codes like 200 for success and 500 for internal server error.
7. Use JSON for API response.
8. Use camel case in field names.
9. Should have a suitable exception handling mechanism.
10. API Should have proper security mechanism like authentication,rate limiting,etc.
No comments:
Post a Comment
If you have any doubt, please let me know