I'm trying to design REST services in a correct way, but encountered a few moments I'm not sure of, but should be pretty common:
For example, I have entity
car
and I get it bycar/{id}
. What if I want to have a separate requests for car details (object with a lot of additional properties)? Should it look likecar/details/{id}
orcar/{id}/details
?I want to call some action not from CRUD, like
upload
oruploadAndProcess
. I can't name them directly, since verbs are not allowed in REST. How the request should look like? Something likePOST car/{id}/upload/activate
orPOST car/{id}?upload=true,activate=true
?I've read few articles that says, that it's not allowed to use anything in path variables except ids, and everything else should be sent as request attributes. And the other says, that it's ok to use them for required attributes. Which is true?