Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a RequestF
data type which contains components required for
creation of an HTTP Request.
RequestF
data is built from type level API endpoints and the BaseUrl
with in the HasRequest
class instance.
Synopsis
- data RequestF body = Request {
- reqPath :: Text
- reqMethod :: Method
- reqBody :: Maybe (body, MediaType)
- reqQueryString :: Seq QueryItem
- reqHttpVersion :: HttpVersion
- reqAccept :: Maybe MediaType
- reqHeaders :: Seq Header
- data RequestBody
- type Request = RequestF RequestBody
- defaultRequest :: Request
- appendMethod :: Method -> Request -> Request
- appendToPath :: Text -> Request -> Request
- appendToQueryString :: QueryItem -> Request -> Request
- addHeader :: ToHttpApiData a => HeaderName -> a -> Request -> Request
- setReqBody :: RequestBody -> MediaType -> Request -> Request
Request
Request | |
|
data RequestBody Source #
The Request body replica of the http-client
RequestBody
.
Instances
Eq RequestBody Source # | |
Defined in Hreq.Core.Client.Request (==) :: RequestBody -> RequestBody -> Bool # (/=) :: RequestBody -> RequestBody -> Bool # | |
Show RequestBody Source # | |
Defined in Hreq.Core.Client.Request showsPrec :: Int -> RequestBody -> ShowS # show :: RequestBody -> String # showList :: [RequestBody] -> ShowS # |
type Request = RequestF RequestBody Source #
Default Request
Request helper functions
addHeader :: ToHttpApiData a => HeaderName -> a -> Request -> Request Source #
setReqBody :: RequestBody -> MediaType -> Request -> Request Source #