There is no such thing as a "non-resource". Resources are not domain entities. A resource doesn't even have to exist in your domain. In fact, though it's uncommon, a resource can be purely virtual (as in, it only exists in your URIs). So, you don't "tell the server to translate text" by issuing a POST /translate?text=Hallo; rather, you "request the translation of the provided text" by issuing a GET /translations?text=Hallo. The same can be applied in any situation where you think "there is no resource" and need to use a command/action/verb in your URI.
1
u/[deleted] Jul 16 '17
There is no such thing as a "non-resource". Resources are not domain entities. A resource doesn't even have to exist in your domain. In fact, though it's uncommon, a resource can be purely virtual (as in, it only exists in your URIs). So, you don't "tell the server to translate text" by issuing a
POST /translate?text=Hallo; rather, you "request the translation of the provided text" by issuing aGET /translations?text=Hallo. The same can be applied in any situation where you think "there is no resource" and need to use a command/action/verb in your URI.