Hi Chaps,

I'm building a REST style application, and would like to return a 201
response code when a user creates a new resource in my application.

The HTTP 1.1 spec also states that I should set the Location response
header to the URI of my newly created resource.

I've tried:

cherrypy.response.headers['Location'] = uri
cherrypy.response.status = 201
return dict(x=x,y=y)

But it seems that cherrypy or TurboGears overrides my status code to
201, and also removes the header, as when I check headers and status
code, the Location header is missing and the status code is 200.

I've also tried raise cherrypy.HTTPError(201), but this generates an
exception stating that status codes must be between 400 and 599.

Any ideas on the best way to achieve this?

-Sw.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to