Get post function back without overwriting content

This commit is contained in:
Konstantine Rybnikov 2013-07-29 17:00:32 +03:00
parent 8664c010da
commit fdb564abfe

View File

@ -464,7 +464,9 @@ addNonce = addNonce_ ""
post :: (Yesod site, RedirectUrl site url) post :: (Yesod site, RedirectUrl site url)
=> url => url
-> YesodExample site () -> YesodExample site ()
post url = postBody url "" post url = request $ do
setMethod "POST"
setUrl url
-- | Perform a POST request to url with sending a body into it. -- | Perform a POST request to url with sending a body into it.
postBody :: (Yesod site, RedirectUrl site url) postBody :: (Yesod site, RedirectUrl site url)
@ -472,9 +474,9 @@ postBody :: (Yesod site, RedirectUrl site url)
-> BSL8.ByteString -> BSL8.ByteString
-> YesodExample site () -> YesodExample site ()
postBody url body = request $ do postBody url body = request $ do
setRequestBody body
setMethod "POST" setMethod "POST"
setUrl url setUrl url
setRequestBody body
-- | Perform a GET request to url, using params -- | Perform a GET request to url, using params
get :: (Yesod site, RedirectUrl site url) get :: (Yesod site, RedirectUrl site url)