The following offers a suggested set of URI naming guidelines for REST web service APIs that have worked for me in practice.
The book RESTful Web Services RESTful Web Services defines three basic rules for url design which act as a great starting point:
The book RESTful Web Services RESTful Web Services defines three basic rules for url design which act as a great starting point:
- Use path variables to encode hierarchy: /parent/child
- Put punctuation characters in path variables to avoid implying hierarchy where none exists: /parent/child1;child2
- Use query variables to imply inputs into an algorithm, for example: /search?q=jellyfish&start=20