Re: RESTful batch operations
Hi Erick, On Feb 2, 2010, at 10:21 AM, Erick Fleming wrote: > This is more of a REST question, but is anyone using Restlet to > handle batch operations? > > For example: given the following resource: /api/blog/1/posts. I > would like to make client-side changes, then update them on one call. > > I realize this is very SOAP like, but was wonder how Restlet users > are handling these sorts of Use Cases. If you want to update the whole collection of posts, it's RESTful to allow PUT to /api/blog/1/posts. PUT semantics are "I want the resource to reflect the representation I'm giving you here exactly." If you want to update only some of the posts (and you don't want to re- send the ones you aren't modifying to avoid, say, concurrent modification problems), one model is to define a subset resource. Something like: /api/blog/1/posts?subset=3,4,8,11 or maybe /api/blog/1/posts/subset/3;4;8;11 this resource would represent just the posts with IDs 3, 4, 8, and 11. GET would return a collection containing just those items and PUT would accept new representations for just those items, leaving the other posts alone. This kind of violates HATEOAS (since the client needs to know how to generate the subset URI), but I think it's an acceptable tradeoff. There's also the proposed HTTP PATCH method. I don't know the status of that. Rhett -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2444225
Re: RESTful batch operations
The philosophical answer: RESTful HTTP doesn't have semantics to support BATCH operations. There has been conversations in the IETF about supporting a BATCH method, but it hasn't really gone anywhere. For servers that support HTTP pipelining you can issue multiple asynchronous GET requests, but I don't think this is what your really have in mind. The more practical solution: GDATA has an implementation of BATCH processing using POST based upon AtomPub. Its completely non-standard but you could potentially implement the protocol on top of RESTlet. Dave On Tue, Feb 2, 2010 at 8:21 AM, Erick Fleming wrote: > This is more of a REST question, but is anyone using Restlet to handle batch > operations? > For example: given the following resource: /api/blog/1/posts. I would like > to make client-side changes, then update them on one call. > I realize this is very SOAP like, but was wonder how Restlet users are > handling these sorts of Use Cases. > -- > Erick Fleming > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2444223
RESTful batch operations
This is more of a REST question, but is anyone using Restlet to handle batch operations? For example: given the following resource: /api/blog/1/posts. I would like to make client-side changes, then update them on one call. I realize this is very SOAP like, but was wonder how Restlet users are handling these sorts of Use Cases. -- Erick Fleming -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2444206