http-client-0.1.0.0: An HTTP client engine, intended as a base layer for more user-friendly packages.

Safe HaskellNone

Network.HTTP.Client.Request

Synopsis

Documentation

parseUrl :: Failure HttpException m => String -> m RequestSource

Convert a URL into a Request.

This defaults some of the values in Request, such as setting method to GET and requestHeaders to [].

Since this function uses Failure, the return monad can be anything that is an instance of Failure, such as IO or Maybe.

setUriRelative :: Failure HttpException m => Request -> URI -> m RequestSource

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.

getUri :: Request -> URISource

Extract a URI from the request.

setUri :: Failure HttpException m => Request -> URI -> m RequestSource

Validate a URI, then add it to the request.

browserDecompress :: ContentType -> BoolSource

Decompress a compressed stream unless the content-type is 'application/x-tar'.

alwaysDecompress :: ContentType -> BoolSource

Always decompress a compressed stream.

addProxy :: ByteString -> Int -> Request -> RequestSource

Add a proxy to the Request so that the Request when executed will use the provided proxy.

applyBasicAuth :: ByteString -> ByteString -> Request -> RequestSource

Add a Basic Auth header (with the specified user name and password) to the given Request. Ignore error handling:

applyBasicAuth user pass $ fromJust $ parseUrl url

urlEncodedBody :: [(ByteString, ByteString)] -> Request -> RequestSource

Add url-encoded parameters to the Request.

This sets a new requestBody, adds a content-type request header and changes the method to POST.

needsGunzipSource

Arguments

:: Request 
-> [Header]

response headers

-> Bool 

useDefaultTimeout :: Maybe IntSource

Magic value to be placed in a Request to indicate that we should use the timeout value in the Manager.

Since 1.9.3