Naming conventions
REST APIs must be organized around resources of the system and must be easy to understand by just looking at the URIs. URIs must focus on one resource type at a time with operations mapped to HTTP request methods. They may have one or more related resources that can be further nested in the URI.
Good examples of URIs are /users, /consumers, /orders, and /services, not /getusers, /showorders, and more. A basic rule to define API URIs is to target nouns as resources and verbs as HTTP methods. For example, instead of creating a URI as /getusers, it is recommended to have the URI as /users with the HTTP method as GET. Similarly, instead of /showorders, the URI GET /orders must be created to provide all the orders in the response ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access