network-api-support-0.0.8: Toolkit for building http client libraries over Network.Http.Conduit

Safe HaskellNone

Network.Api.Support.Request

Synopsis

Documentation

type RequestTransformer = Endo RequestSource

A RequestTransformer allows you to build up attributes on the request. | RequestTransformer is simply an Endo, and therefore has a Monoid, so | can be combined with <>.

setApiKey :: ByteString -> RequestTransformerSource

Set an api key for use with basic auth.

setParams :: [(ByteString, ByteString)] -> RequestTransformerSource

Set request query parameters.

stripHeader :: CI ByteString -> RequestTransformerSource

Set a request headers.

setCookieJar :: CookieJar -> UTCTime -> RequestTransformerSource

Register all cookies in cookie jar against request.

setMethod :: ByteString -> RequestTransformerSource

Set the request method to be the specified name.

setBody :: ByteString -> RequestTransformerSource

Set the request body from the specified byte string.

setBodyLazy :: ByteString -> RequestTransformerSource

Set the request body from the specified lazy byte string.

setJson :: ToJSON a => a -> RequestTransformerSource

Set the request body from the value which can be converted to JSON.

(<>) :: Monoid m => m -> m -> m

An infix synonym for mappend.