--
You received this message because you are subscribed to the Google Groups "Hypermedia Web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hypermedia-we...@googlegroups.com.
To post to this group, send email to hyperme...@googlegroups.com.
Visit this group at http://groups.google.com/group/hypermedia-web.
For more options, visit https://groups.google.com/d/optout.
Just some addition info on how we handle this. Every request that is NOT a GET returns an [actionStatus]. A Status 200 or 201 will contain the following [actionStatus] (example in json of course).
{header:{
actionStatusID:’e747ff45-6d7b-4bfc-8dd7-dbf8ea1ebfd5’,
status:’Complete’,
percentComplete:100,
message:’Record Created’},
data:{
[payload]
}}
Just some addition info on how we handle this. Every request that is NOT a GET returns an [actionStatus]. A Status 202will contain the following actionStatus.
{header:{
actionStatusID:’e747ff45-6d7b-4bfc-8dd7-dbf8ea1ebfd5’,
status:’Pending’,
percentComplete:0,
message:’Request Received’},
links:[{
id:’status-check’,
method:’GET’,
url:’http:// mydomain.com/api/actionStatuses/e747ff45-6d7b-4bfc-8dd7-dbf8ea1ebfd5’}]
}
~Joe
ServiceMonster|Principal Focus, LLC
To be honest, this is just an example I'm creating for a pattern document on how to implement "actions" restfully so while I want it to be accurate, it's not something that I'm actually implementing so take that into account.
I'm still wondering whether it's valid to return a 204 and set the Location header to the transfer resource. The thinking behind this is that most of the time the client would only be interested in knowing whether it was successful or not and not really interested in inspecting the transfer representation so why bother including it in the response.
@Kijana Very cool blog post post about 204, never had though about the loss of context a 204 causes (some of those things that are immediately obvious once someone points them out but never crossed your mind until then!). Thx for the link.
The 204 response allows a server to indicate that the action has been successfully applied to the target resource, while implying that the user agent does not need to traverse away from its current "document view" (if any). The server assumes that the user agent will provide some indication of the success to its user, in accord with its own interface, and apply any new or updated metadata in the response to its active representation."
--
My guess is the problem involves the idea of a stateless client that would be "lost" without context.Now whether clients *should* be stateless is another matter...
See http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1 section 5.1.3.
RegardsWe next add a constraint to the client-server interaction: communication must be stateless in nature, as in the client-stateless-server (CSS) style of Section 3.4.3 , such that each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client. ... Like most architectural choices, the stateless constraint reflects a design trade-off. The disadvantage is that it may decrease network performance by increasing the repetitive data (per-interaction overhead) sent in a series of requests, since that data cannot be left on the server in a shared context. In addition, placing the application state on the client-side reduces the server's control over consistent application behavior, since the application becomes dependent on the correct implementation of semantics across multiple client versions.