RESTful API Best Practices
-
Use query string to filter resource collections
-
Never use CRUD function names in URIs
-
Do not use underscores in URIs
-
Do not use file extensions in API endpoint URIs
-
Use lowercase letters in URIs
-
Do not use forward trailing slash in URLs
-
Use the right terminology
-
Use consistent patterns across all API endpoints
-
Do not return plain text
-
Use SSL to protect your data during transfer
-
Your API should be stateless
-
Do not use session in your RESTful API endpoints
-
Do not trust the input parameters
-
Use correct HTTP status codes
-
Use HTTP headers for content negotiation
-
Use sub-resources for relations
-
GET should never change the state
-
Use plural nouns
-
Use correct HTTP methods
-
Use nouns, not verbs
-
Become a Best practice hero.Help us to grow the catalogue of best practices.
Recently added best practices
- Avoid #region in your code wherever possible
- Remove unused using statements
- Do not use "this" keyword
- Use Resharper
- Use query string to filter resource collections
- Never use CRUD function names in URIs
- Do not use underscores in URIs
- Do not use file extensions in API endpoint URIs
- Use lowercase letters in URIs
- Do not use forward trailing slash in URLs
- Use the right terminology
- Use consistent patterns across all API endpoints
- Do not return plain text
- Use SSL to protect your data during transfer
- Your API should be stateless
- Do not use session in your RESTful API endpoints
- Do not trust the input parameters
- Use correct HTTP status codes
- Use HTTP headers for content negotiation
- Use sub-resources for relations
Comments
0
/
0