on master help sign in
Add minimal cookie support
1d5147amrkkrp
Network/HTTP/Req.hs+12
@@ -133,6 +133,7 @@ module Network.HTTP.Req
133 , header
133 , header
134 -- *** Cookies
134 -- *** Cookies
135 -- $cookies
135 -- $cookies
136+ , cookieJar
136 -- *** Authentication
137 -- *** Authentication
137 -- $authentication
138 -- $authentication
138 , basicAuth
139 , basicAuth
@@ -681,6 +682,17 @@ attachHeader name value x =
681-- Request — Optional parameters — Cookies
682-- Request — Optional parameters — Cookies
682
683
683-- $cookies
684-- $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 }
684
696
685----------------------------------------------------------------------------
697----------------------------------------------------------------------------
686-- Request — Optional parameters — Authentication
698-- Request — Optional parameters — Authentication