Web API Convention:
Web API conventions are basically set of rules that guides to build maintainable, scalable APIs and and provides consistency as well.
- Use of Http methods properly like GET, PUT, POST, PATCH, DELETE.
- Then it comes to naming convention which tells us to use nouns not verbs such as /users , /invoices etc.
- One more thing in namming convention is that not to use action in the path for example /getUsers instead of it use method GET and keep name a noun like /users.
- The third thing using appropriate status codes for corresponding status for example 200 for success and 400 for bad request and so on.
- And at last use versioning e.g. /v1/users and consistent request and response formats i.e. JSON format.
Top comments (0)