Shawn Grover
Nov 4, 2020

--

REST by definition maps HTTP verbs (get, post, put, delete) to CRUD operations. (https://en.wikipedia.org/wiki/Representational_state_transfer)

If I need an end point to trigger some process that is not strictly an entity UPDATE, I'll use a POST request. Maybe something like "update address states and synchronize data with the ERP system" as a single step (made up example). This technically violates the REST definition as an HTTP verb is being repurposed for something else. Resulting in an API this is not fully REST compliant.

An argument could be made that such an overloaded endpoint is a code smell indicating an architecture problem. Sometimes we knowingly ignore those warnings for the sake of conciseness or a clearer domain language definition. It is a judgement call each time.

--

--

Shawn Grover
Shawn Grover

Responses (2)