http-conduit-1.9.0: HTTP client package with conduit interface and HTTPS support.

Safe HaskellNone

Network.HTTP.Conduit.Internal

Contents

Synopsis

Documentation

getUri :: Request m' -> URI

Extract a URI from the request.

setUri :: Failure HttpException m => Request m' -> URI -> m (Request m')

Validate a URI, then add it to the request.

setUriRelative :: Failure HttpException m => Request m' -> URI -> m (Request m')

Add a URI to the request. If it is absolute (includes a host name), add it as per setUri; if it is relative, merge it with the existing request.

Redirect loop

httpRedirect

Arguments

:: (MonadBaseControl IO m, MonadResource m, Monad m1) 
=> Int

redirectCount

-> (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)

liftResourceT

-> 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)

Apply 'Request'\'s checkStatus and return resulting exception if any.

Cookie functions

updateCookieJar

Arguments

:: 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

receiveSetCookie

Arguments

:: SetCookie

The SetCookie the cookie jar is receiving

-> Request m

The request that originated the response that yielded the SetCookie

-> 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.

generateCookie

Arguments

:: SetCookie

The SetCookie we are encountering

-> Request m

The request that originated the response that yielded the SetCookie

-> 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

insertCheckedCookie

Arguments

:: Cookie

The SetCookie the cookie jar is receiving

-> 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)

insertCookiesIntoRequest

Arguments

:: 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

computeCookieString

Arguments

:: 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"

evictExpiredCookies

Arguments

:: CookieJar

Input cookie jar

-> UTCTime

Value that should be used as "now"

-> CookieJar

Filtered cookie jar

This corresponds to the eviction algorithm described in Section 5.3 "Storage Model"