I have read through the documentation many times over and search all over for the answer to this question but have come up short. Specifically I've looked at Defining the service and the Cornice API for a service and at Defining resource for resource.
I'm currently building a REST API that will have a similar structure to this:
GET /clients # Gets a list of clients
GET /clients/{id} # Gets a specific client
GET /clients/{id}/users # Gets a specific clients users
What would be the best way to go about this? Should I use a service or a resource or both? And, if both, how?
/resourcename/{id}
in the path, but what if I need the ability to PUT or POST. Should I just remove the {id} matchdict and simply have the path go to/resourcename
and check for the presence of anid
in the specific put/get method instead since it should not really exist in the POST? – Fortyishid
is known/resource is updated. For a POST you will want to add data in the form-data or json-payload, but you'll not know theid
, otherwise it would be a PUT by the REST-definition. – Shitty