2 ms·
> GET is for retrieving a resource, which is like a fixed representation of data. In your example, you're trying to do a function call, an RPC, and badly mappin
by masklinn 15y ago
> GET is for retrieving a resource, which is like a fixed representation of data. In your example, you're trying to do a function call, an RPC, and badly mapping it to HTTP semantics.
I don't really agree with that: he wants to retrieve a subset of a resource, that's a resource in itself. Using a more standard selection language, his query could be rewritten:
GET /orders/432544?path=%2Ftoppings%2Fcalories HTTP/1.1
and would be perfectly sensible.
- rhizome 15y agoMy read is that without id's, having broken-out calories like the GGP's is a broken data model and/or API. The API should be returning a sum of the calories for a particular order, which supports GP's "RPC" argument. Either that, or returning ingredient ids with their calories counts.
- masklinn 15y ago> My read is that without id's, having broken-out calories like the GGP's is a broken data model and/or API. IDs are not involved at any point, and are not even relevant to bsaunder's comment. > Either that, or returning ingredient ids with their calories counts. An API which returns identifiers is not a REST API, so this statement makes no sense. Now more to the point, bsaunder is simply looking for a way to fetch a subset of a resource by providing some sort of filter. I truly do not see why that would not be restful, it's simply a search query, what do you think happens when you search something in Google? It returns a resource which is the subset of an other resource (their complete index, which they don't expose but that does not really matter), and as far as I can tell nobody's accused search engines of failing to be restful yet. (the sum stuff doesn't even make sense)