[web-devel] [Yesod] When POST and create new resource

Michael Snoyman michael at snoyman.com
Sat Nov 27 21:12:09 CET 2010


2010/11/27 いとうかつとし <cutsea110 at gmail.com>:
> Hi
> I have a question.
> I think that,  when a server receive POST request and create new
> resource(and URI),
> the server response is status 201, isn't it?
> (I'm not really sure about this idea.)
> On Yesod, How we write to make status201 response?

Good catch, there is not currently a way to specify arbitrary response
codes in Yesod. I think two API additions are in order:

* respondCreated (or some better name) which sends a 201 response.
This function should take a Route master argument.
* sendResponseStatus, which is like sendResponse but also takes a
Status argument (Status coming from the Network.Wai module).

Any thoughts?

Michael


More information about the web-devel mailing list