Skip to main content
added 4 characters in body
Source Link
Robert Bräutigam
  • 12.3k
  • 1
  • 19
  • 38

What you're describing would technically work and would not contradict any hard rules.

However there are some conventions. For example that the path structure reflects the object structure a bit. That means GET https://myApi.com/docs should normally list all documents, just like a directory.

Also, by convention URIs should be things (resources), not verbs, so findAll sounds off a bit.

Also, if you want to retrieve data from the server (read-only operation), those should be GET operations, not POST.

Again, these are just conventions, and you can safely ignore them if you wanthave reason to do so. URIs can be basically anything you wish. They can contain IDs of any sort, numbers or strings, they can "overload" the ID namespace with special values (like findAll) or none of the above. It is up to the server.

What you're describing would technically work and would not contradict any hard rules.

However there are some conventions. For example that the path structure reflects the object structure a bit. That means https://myApi.com/docs should normally list all documents, just like a directory.

Also, by convention URIs should be things (resources), not verbs, so findAll sounds off a bit.

Also, if you want to retrieve data from the server (read-only operation), those should be GET operations, not POST.

Again, these are just conventions, and you can safely ignore them if you want. URIs can be basically anything you wish. They can contain IDs of any sort, numbers or strings, they can "overload" the ID namespace with special values (like findAll) or none of the above. It is up to the server.

What you're describing would technically work and would not contradict any hard rules.

However there are some conventions. For example that the path structure reflects the object structure a bit. That means GET https://myApi.com/docs should normally list all documents, just like a directory.

Also, by convention URIs should be things (resources), not verbs, so findAll sounds off a bit.

Also, if you want to retrieve data from the server (read-only operation), those should be GET operations, not POST.

Again, these are just conventions, and you can safely ignore them if you have reason to do so. URIs can be basically anything you wish. They can contain IDs of any sort, numbers or strings, they can "overload" the ID namespace with special values (like findAll) or none of the above. It is up to the server.

Source Link
Robert Bräutigam
  • 12.3k
  • 1
  • 19
  • 38

What you're describing would technically work and would not contradict any hard rules.

However there are some conventions. For example that the path structure reflects the object structure a bit. That means https://myApi.com/docs should normally list all documents, just like a directory.

Also, by convention URIs should be things (resources), not verbs, so findAll sounds off a bit.

Also, if you want to retrieve data from the server (read-only operation), those should be GET operations, not POST.

Again, these are just conventions, and you can safely ignore them if you want. URIs can be basically anything you wish. They can contain IDs of any sort, numbers or strings, they can "overload" the ID namespace with special values (like findAll) or none of the above. It is up to the server.