path segment
One slash-separated piece of the path in a web address, such as tasks or 1 in /tasks/1.
In more detail
Path segments identify: if removing one makes the address mean a different thing, it belongs in the path. So a collection, an item identifier and a relationship such as /tasks/1/owner go in the path, while filters and page sizes go in the query string.
Related terms
- query string — The part of a web address after the question mark, made of name=value pairs, such as ?state=open&limit=2.
- URI — A string that identifies a resource, written with a scheme and usually a path, such as https://api.example.com/tasks/1; every URL is a URI.
- collection resource — A resource that holds a set of similar items, addressed with a plural noun such as /tasks.
- sub-resource — A resource addressed beneath another, such as /tasks/1/owner, usually to express a relationship.
Taught in
- Headers And Content Negotiation — Modern API Architecture: REST, GraphQL & gRPC
- Naming Resources And Collections — Modern API Architecture: REST, GraphQL & gRPC
- Sub-resources And Relationships — Modern API Architecture: REST, GraphQL & gRPC