Hacker News new | ask | show | jobs
by billpg 2900 days ago
The way I think of it is that GET, PUT, PATCH and DELETE all deal with data, whereas POST is a call to action.

It is a little unfortunate that we don't have a CREATE verb (distinct from the update-ness of PUT) and we need to use POST for this purpose.

2 comments

I've had to support http clients that could only do GET and POST. So I tend to do everything by those two verbs, even though it's not academically correct.
That's interesting. Are you saying that you view Posts as verbs/processes which only result in side effects of the underlying system but do not change the state of data? I'm trying to understand what you would consider the domain of actions that would fall under your Post categorization. Batch Jobs, Emailing reports etc.?
That's basically right. I view GET/PUT/PATCH/DELETE/CREATE as simple wrappers around SQL commands, with validation and authorization checks.

POST is a call to do something with that data, which might include changing the data. Off the top of my head, logging in, actions with external systems, sending emails.