Safe Haskell | None |
---|---|
Language | Haskell98 |
- type RequestTransformer = Endo Request
- setApiKey :: ByteString -> RequestTransformer
- setUrlEncodedBody :: [(ByteString, ByteString)] -> RequestTransformer
- setQueryParams :: [(ByteString, Maybe ByteString)] -> RequestTransformer
- setHeaders :: [(CI ByteString, ByteString)] -> RequestTransformer
- setHeader :: (CI ByteString, ByteString) -> RequestTransformer
- addHeader :: (CI ByteString, ByteString) -> RequestTransformer
- stripHeader :: CI ByteString -> RequestTransformer
- setCookieJar :: CookieJar -> UTCTime -> RequestTransformer
- setMethod :: ByteString -> RequestTransformer
- setBody :: ByteString -> RequestTransformer
- setBodyLazy :: ByteString -> RequestTransformer
- setJson :: ToJSON a => a -> RequestTransformer
- (<>) :: Monoid m => m -> m -> m
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.
setHeaders :: [(CI ByteString, ByteString)] -> RequestTransformer Source
Set request headers.
setHeader :: (CI ByteString, ByteString) -> RequestTransformer Source
Set a request headers.
addHeader :: (CI ByteString, ByteString) -> RequestTransformer Source
Add a request headers.
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.