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

Safe HaskellNone
LanguageHaskell98

Network.Api.Support.Request

Synopsis

Documentation

type RequestTransformer = Endo Request Source #

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 -> RequestTransformer Source #

Set an api key for use with basic auth.

setUrlEncodedBody :: [(ByteString, ByteString)] -> RequestTransformer Source #

Set URL encoded form params on the request body.

setQueryParams :: [(ByteString, Maybe ByteString)] -> RequestTransformer Source #

Set request query parameters.

stripHeader :: CI ByteString -> RequestTransformer Source #

Set a request headers.

setCookieJar :: CookieJar -> UTCTime -> RequestTransformer Source #

Register all cookies in cookie jar against request.

setMethod :: ByteString -> RequestTransformer Source #

Set the request method to be the specified name.

setBody :: ByteString -> RequestTransformer Source #

Set the request body from the specified byte string.

setBodyLazy :: ByteString -> RequestTransformer Source #

Set the request body from the specified lazy byte string.

setJson :: ToJSON a => a -> RequestTransformer Source #

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

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.