make get and post use performMethod

This commit is contained in:
pythonissam 2018-04-14 06:46:38 +00:00
parent 7ad28d227c
commit a9030aa294

View File

@ -895,9 +895,7 @@ getRequestCookies = do
post :: (Yesod site, RedirectUrl site url) post :: (Yesod site, RedirectUrl site url)
=> url => url
-> YesodExample site () -> YesodExample site ()
post url = request $ do post = performMethod "POST"
setMethod "POST"
setUrl url
-- | Perform a POST request to @url@ with the given body. -- | Perform a POST request to @url@ with the given body.
-- --
@ -926,9 +924,7 @@ postBody url body = request $ do
get :: (Yesod site, RedirectUrl site url) get :: (Yesod site, RedirectUrl site url)
=> url => url
-> YesodExample site () -> YesodExample site ()
get url = request $ do get = performMethod "GET"
setMethod "GET"
setUrl url
-- | Perform a request using a given method to @url@. -- | Perform a request using a given method to @url@.
-- --