|
|
|
|
|
by blowski
3569 days ago
|
|
I'll give a specific specific example from my own experience of building an intranet. I had documents that people could print. POST /documents/12345/print
To me, while this was not RESTful, it was the most readable way I came up with. When I asked somebody who had more experience with REST than me, he suggested I build the URL like this: POST /users/123/print-jobs
url=/documents/12345
Doing this, I would have to add validation to make sure it was a printable URL. Also, there was no corresponding GET request, so it seemed pointless. And it made the code weirder, as the 'print' action would be separated from the rest of the actions on documents.So how would you do it instead? Or you would do it the same way, and just not worry about the problem? It seems that consensus on how to do REST breaks down when you have custom verbs. |
|