3 ms·
I wish there was a standard way to do batch operations in REST though
by EGreg 12y ago
I wish there was a standard way to do batch operations in REST though
- bostond 12y agoThere is a proposal for such a standard for json document APIs: https://tools.ietf.org/html/rfc6902 https://tools.ietf.org/html/rfc6902 I'm not sure where this stands in the standards track.
- zkhalique 12y agoI took a look through it, and it seems woefully inadequate for batching "get" requests together. Say I want to get 90 disparate items, shouldn't I be able to batch those into one or two requests? On the server, I may have some cache in the script so I don't have to re-request the same items 90 times. For example I want to get 40 rooms, and for 20 of them, I want to get up to 20 participants in the rooms. My JS code shouldn't have to care about the batching. It should just send out batched requests, and the callbacks should be called. On the client side, we have this: http://platform.qbix.com/guide/patterns http://platform.qbix.com/guide/patterns -- see Q.batcher.factory But on the server side, we've had to implement our own format to get that implemented.
- timblair 12y agoJSON API [1] is an attempt to standardise the request and response formats for JSON APIs, and it supports an extension which permits multiple operations in a single request [2]. Facebook have their own, similar method of supporting batched calls through the Graph API [3], and this even permits you to specify dependencies between operations in a single request using JSONPath [4]. [1] http://jsonapi.org/ http://jsonapi.org/ [2] http://jsonapi.org/extensions/bulk/ http://jsonapi.org/extensions/bulk/ [3] https://developers.facebook.com/docs/graph-api/making-multiple-requests https://developers.facebook.com/docs/graph-api/making-multip... [4] https://code.google.com/p/jsonpath/ https://code.google.com/p/jsonpath/