Ooops. Not P/R/G. You want, then: response.setStatus(Status.SUCCESS_CREATED); response.setLocationRef(yourCreatedURIString);
- R ----- Original Message ----- From: "Jim Alateras" <[EMAIL PROTECTED]> To: discuss@restlet.tigris.org Sent: Thursday, September 6, 2007 4:23:17 PM (GMT-0500) America/New_York Subject: Re: setting the location header Rob, Thanks for all the information. > > > for the use case you describe. From the Javadoc (which is copied from > RFC 2616, HTTP/1.1): > > "Redirects the client to a different URI that SHOULD be retrieved using > a GET method on that resource. This method exists primarily to allow > the output of a POST-activated script to redirect the user agent to a > selected resource. The new URI is not a substitute reference for the > originally requested resource." > > So this sets the 303 status code and the target, which is probably what > you want for a Post/Redirect/Get pattern. > According to the Atom Publishing Protocol and i could be way wrong but on POST, which creates the new resource I want to return a 201 and set the Location header to newly created resource. > - Rob >