I'm using an HTTP resource path to execute a backend action instead of providing a resource. An example would be adding a holiday feature to a holiday package on a travel website:
/holiday/Paris/feature/canal-trip
In this example the feature canal-trip
would be added to my planned trip to Paris
. After this action
there might be a redirect to the main resource page.
It's clear that this is not strictly a REST resource GET, however I wonder:
- how much this is a REST violation?
- what disadvantages this could cause? (If the action path is not indexed by search engines.)
- what is a better way to provide a path where visitors can execute an action on behalf of a resource?
For this issue let's say CSRF is not an issue - the action is harmless. The most similar question I've found is this: REST actions and URL API design considerations - however in my case I have no intention to make it a real REST endpoint. Only would like to avoid violations.