Add back sendResponseCreated
This commit is contained in:
parent
7cf5609009
commit
610529d7bf
@ -50,6 +50,7 @@ module Yesod.Handler
|
||||
, sendFile
|
||||
, sendResponse
|
||||
, sendResponseStatus
|
||||
, sendResponseCreated
|
||||
-- * Setting headers
|
||||
, setCookie
|
||||
, deleteCookie
|
||||
@ -441,6 +442,13 @@ sendResponseStatus :: HasReps c => W.Status -> c -> GHandler s m a
|
||||
sendResponseStatus s = GHandler . lift . throwMEither . HCContent s
|
||||
. chooseRep
|
||||
|
||||
-- | Send a 201 "Created" response with the given route as the Location
|
||||
-- response header.
|
||||
sendResponseCreated :: Route m -> GHandler s m a
|
||||
sendResponseCreated url = do
|
||||
r <- getUrlRender
|
||||
GHandler $ lift $ throwMEither $ HCCreated $ r url
|
||||
|
||||
-- | Return a 404 not found page. Also denotes no handler available.
|
||||
notFound :: Failure ErrorResponse m => m a
|
||||
notFound = failure NotFound
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod
|
||||
version: 0.6.5
|
||||
version: 0.6.6
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user