Hi,

To summarize the findings:

We have three (major) use cases

  (1) Standard HTTP Response, e.g. 201 for a resource creation
  (2) Redirect
  (3) HTML Response

(2) is already supported with the ":redirect" parameter as is (3) as the
default behaviour. (1) can easily be added in that we add another
parameter, say ":status", in which case the HTTP status would be set
according to the request outcome and the Location be set in case of 201.
The response content would be the same as in case (3).

Now, with my standards-complying hat on, I would prefer to have (1) the
default behaviour and (3) be the special case controllable with a
parameter.

Now, my question to you guys:

   (a) would this suit your needs ?
   (b1) do you want a parameter to enable (3) - (1) is default
or (b2) do you want a parameter to enable (1) - (3) is default

Comments ?

Regards
Felix

Am Dienstag, den 29.04.2008, 10:17 +0200 schrieb Alexander Saar:
> Hi all,
> I tried to create nodes with random names using Sling Post Servlet and  
> XHR, but I always receive responses with status code 200 and not 201  
> as expected. Also the Location header is missing in the response. Lars  
> pointed me to the discussion around this issues in [1]. But I'm  
> wondering if there is a consensus on how to solve this? In my eyes  
> parsing a XML files to find out what happened is a "no go", because  
> this is not standardized in HTTP (which is the interface contract we  
> are using here) and it is not funny to deal with this in client side  
> JS. On the other hand normal form posts and XHR requests are likely to  
> occur more frequently than hidden iframes.
> 
> So I would suggest to implement the proposal from Felix, which means  
> the response always contains the correct response codes and header  
> fields (like Location) and there will be another request parameter  
> which allows to override the response code for special case handling  
> like hidden iframes in forms. This parameter could be named  
> sling:post:responseCodeOverride and the value could be the response  
> code that should be used. If the parameter is not present the real  
> response code will be send.
> 
> WDYT?
> 
> Regards,
> Alex
> 
> [1] https://issues.apache.org/jira/browse/SLING-292
> 

Reply via email to