2 ms·
I thought we were talking about RPC over HTTP. My RPC examples don't qualify as "proper" REST where you are only supposed to GET and POST singular resources at
by bigmanwalter 10y ago
I thought we were talking about RPC over HTTP.
My RPC examples don't qualify as "proper" REST where you are only supposed to GET and POST singular resources at a time. In order to post multiple, you need a collection identifier. In REST, you can't GET "items", you can get "item1" and "item2" or you can get "collection1" to which "item1" and "item2" belong.
Maybe a clearer example around running a script:
REST:
POST /api/action { action: do_the_thing }
RPC:
POST /api/do_the_thing
RPC is the most basic mapping of actions > endpoints whereas REST demands you organize everything into resources.
- mercer 10y agoInteresting. It sounds rather similar to me as the way the difference between functional and OO programming is often described (verbs-first vs nouns-first). Is there anything to that or am I comparing apples with non-apples?
- bigmanwalter 10y agoI think there is definitely some basis to your analogy :) I think that it also stems from most ORM's focus on updating single database rows at a time even though operations frequently span across multiple rows. As all data manipulation ultimately happens on the server, I feel it's often unnecessary to keep track of individual resources in the client.