Safe Haskell | None |
---|
- getUri :: Request m' -> URI
- setUri :: Failure HttpException m => Request m' -> URI -> m (Request m')
- setUriRelative :: Failure HttpException m => Request m' -> URI -> m (Request m')
- httpRedirect :: (MonadBaseControl IO m, MonadResource m, Monad m1) => Int -> (Request m1 -> m (Response (ResumableSource m1 ByteString), Maybe (Request m1))) -> (forall a. m1 a -> m a) -> Request m1 -> m (Response (ResumableSource m1 ByteString))
- applyCheckStatus :: (MonadResource m, MonadBaseControl IO m) => (Status -> ResponseHeaders -> CookieJar -> Maybe SomeException) -> Response (ResumableSource m ByteString) -> m (Maybe SomeException)
- updateCookieJar :: Response a -> Request m -> UTCTime -> CookieJar -> (CookieJar, Response a)
- receiveSetCookie :: SetCookie -> Request m -> UTCTime -> Bool -> CookieJar -> CookieJar
- generateCookie :: SetCookie -> Request m -> UTCTime -> Bool -> Maybe Cookie
- insertCheckedCookie :: Cookie -> CookieJar -> Bool -> CookieJar
- insertCookiesIntoRequest :: Request m -> CookieJar -> UTCTime -> (Request m, CookieJar)
- computeCookieString :: Request m -> CookieJar -> UTCTime -> Bool -> (ByteString, CookieJar)
- evictExpiredCookies :: CookieJar -> UTCTime -> CookieJar
Documentation
setUri :: Failure HttpException m => Request m' -> URI -> m (Request m')Source
Validate a URI
, then add it to the request.
setUriRelative :: Failure HttpException m => Request m' -> URI -> m (Request m')Source
Redirect loop
:: (MonadBaseControl IO m, MonadResource m, Monad m1) | |
=> Int | |
-> (Request m1 -> m (Response (ResumableSource m1 ByteString), Maybe (Request m1))) | function which performs a request and returns a response, and possibly another request if there's a redirect. |
-> (forall a. m1 a -> m a) | |
-> Request m1 | |
-> m (Response (ResumableSource m1 ByteString)) |
Redirect loop
applyCheckStatus :: (MonadResource m, MonadBaseControl IO m) => (Status -> ResponseHeaders -> CookieJar -> Maybe SomeException) -> Response (ResumableSource m ByteString) -> m (Maybe SomeException)Source
Apply 'Request'\'s checkStatus
and return resulting exception if any.
Cookie functions
:: Response a | Response received from server |
-> Request m | Request which generated the response |
-> UTCTime | Value that should be used as "now" |
-> CookieJar | Current cookie jar |
-> (CookieJar, Response a) | (Updated cookie jar with cookies from the Response, The response stripped of any "Set-Cookie" header) |
This applies receiveSetCookie
to a given Response
:: SetCookie | The |
-> Request m | The request that originated the response that yielded the |
-> UTCTime | Value that should be used as "now" |
-> Bool | Whether or not this request is coming from an "http" source (not javascript or anything like that) |
-> CookieJar | Input cookie jar to modify |
-> CookieJar | Updated cookie jar |
This corresponds to the algorithm described in Section 5.3 "Storage Model"
This function consists of calling generateCookie
followed by insertCheckedCookie
.
Use this function if you plan to do both in a row.
generateCookie
and insertCheckedCookie
are only provided for more fine-grained control.
:: SetCookie | The |
-> Request m | The request that originated the response that yielded the |
-> UTCTime | Value that should be used as "now" |
-> Bool | Whether or not this request is coming from an "http" source (not javascript or anything like that) |
-> Maybe Cookie | The optional output cookie |
Turn a SetCookie into a Cookie, if it is valid
:: Cookie | The |
-> CookieJar | Input cookie jar to modify |
-> Bool | Whether or not this request is coming from an "http" source (not javascript or anything like that) |
-> CookieJar | Updated (or not) cookie jar |
Insert a cookie created by generateCookie into the cookie jar (or not if it shouldn't be allowed in)
insertCookiesIntoRequestSource
:: Request m | The request to insert into |
-> CookieJar | Current cookie jar |
-> UTCTime | Value that should be used as "now" |
-> (Request m, CookieJar) | (Ouptut request, Updated cookie jar (last-access-time is updated)) |
This applies the computeCookieString
to a given Request
:: Request m | Input request |
-> CookieJar | Current cookie jar |
-> UTCTime | Value that should be used as "now" |
-> Bool | Whether or not this request is coming from an "http" source (not javascript or anything like that) |
-> (ByteString, CookieJar) | (Contents of a "Cookie" header, Updated cookie jar (last-access-time is updated)) |
This corresponds to the algorithm described in Section 5.4 "The Cookie Header"