3 ms·
Using HTTP methods as verbs is a terrible practice. It works for simple CRUD APIs, but it becomes too limiting once there are more than one way of updating som
by mobjack 6y ago
Using HTTP methods as verbs is a terrible practice.
It works for simple CRUD APIs, but it becomes too limiting once there are more than one way of updating something.
It ties the API design too closely to the data model and usually means that the client has to implement more business logic instead of handling that on the server.
Good API design should decouple business logic from the HTTP spec.
- saila 6y agoThe basic HTTP methods work in the vast majority of cases. The key is to create the appropriate resources--facades that compose the data model and business logic as needed.
- majkinetor 6y agoNo they don't work for vast majority of cases. They work only for CRUD and imposing resources paradigm on everything looks alien.
- hcarvalhoalves 6y agoYou don’t need more than the HTTP methods as long as you reify requests as resources. Instead of “doSomeAction on resource” it’s “POST/PUT /resource/actionRequest”. The trick is stopping and trying to make everything work over CRUD of your main entity resources. HTTP resources don’t need to map to tables.