on master help sign in
Add minimal cookie support
commit1d5147a783c92fddeb574886f966f539bfa81b69 authormrkkrp <markkarpov@opmbx.org> dateSat 29 Oct 2016, 19:22 (10 years ago) parentab2f9e0
1 file changed+12
Network/HTTP/Req.hs+12
Network/HTTP/Req.hs+12
@@ -133,6 +133,7 @@ module Network.HTTP.Req
133133 , header
134134 -- *** Cookies
135135 -- $cookies
136+ , cookieJar
136137 -- *** Authentication
137138 -- $authentication
138139 , basicAuth
@@ -681,6 +682,17 @@ attachHeader name value x =
681682-- Request — Optional parameters — Cookies
682683
683684-- $cookies
685+--
686+-- Support for cookies is quite minimalistic at the moment, its' possible to
687+-- specify which cookies to send using 'cookieJar' and inspect 'L.Response'
688+-- to extract 'L.CookieJar' from it.
689+
690+-- | Use the given 'L.CookieJar'. A 'L.CookieJar' can be obtained from a
691+-- 'L.Response' record.
692+
693+cookieJar :: L.CookieJar -> Option scheme
694+cookieJar jar = withRequest $ \x ->
695+ x { L.cookieJar = Just jar }
684696
685697----------------------------------------------------------------------------
686698-- Request — Optional parameters — Authentication