users@wadl.java.net

Re: How to specify the response status

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 15 Feb 2008 09:43:03 -0500

On Feb 15, 2008, at 8:34 AM, Martin Grotzke wrote:
>
> I have a POST operation that returns HTTP 201 with an appropriate
> Loction header and the representation that would be returned when the
> value of the Location header would be requested via GET.
>
> Is there another way of specifying the HTTP status for a response,
> than
> setting the status attribute of the representation?

No, that's how you do it.

>
> What would I do, if I would not return anything (but 201 and the
> Location)? How would it be possible to specify that 201 is returned?
>
The only way I can see is to have a representation with only the
status attribute set. Note that you can also include a param with
style="header" in the response to be explicit about the location header.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.