Internet-Draft: A Convention for HTTP Access to JSON Resources
tools.ietf.org
tools.ietf.org
Link to the AtomPub RFC: http://tools.ietf.org/html/rfc5023
1. Requiring that the root of the application or domain contain metadata regarding the resources available to the JSON service.
2. Providing a common documentation and structure for nested resources, including perhaps counts and a reference URI for accessing the nested resource, along with an alternate scheme when nested resources are embedded in the resource itself.
3. Documenting how identifiers and references to other resources are included in a JSON object.
4. A standard structure for how collections should be queried (how to reference fields, specify operators, provide values, etc.)
These sorts of concerns are the things in which there's tons of variation and lots of disagreement on standardization. Using HTTP verbs to describe operations in JSON services is well understood and doesn't require much in the way of standardization.
It's really useful to use that "patch" method to combine knowledge from several sources into a single representation. Seems like that problem pops up a lot on the web.
Suppose I'll add it to the list of things I thought I invented.
POST /orders?action=sum&field=price HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{"sum": 9000}
Or actions with side effects: POST /orders?action=process-queue HTTP/1.1
HTTP/1.1 204 No Content
Which is better than creating a specific resource for each of the "actions", such as /orders_sum_price or /orders_process_queue, because it keeps the URIs clean.POST is supposed to be "used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.", which is nonsensical for querying information like sums from collections, and furthermore is supposed to be non-idempotent, which isn't true for a sum operation.
Ideally "action" would be seperated into two different methods, one for manipulating resources (like state machine transitions, or other processing), and one (utilizing GET) for aggregations and computations on collections or resources.
They have done that. See 5.6. Query. Just a mistake by the parent.