
27 Nov
2010
27 Nov
'10
3:12 p.m.
2010/11/27 いとうかつとし
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