| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Servant.Client.Core.Internal.Request
Synopsis
- data ServantError
- data RequestF a = Request {}
- type Request = RequestF Builder
- data RequestBody
- = RequestBodyLBS ByteString
- | RequestBodyBS ByteString
- | RequestBodyBuilder Int64 Builder
- | RequestBodyStream Int64 ((IO ByteString -> IO ()) -> IO ())
- | RequestBodyStreamChunked ((IO ByteString -> IO ()) -> IO ())
- | RequestBodyIO (IO RequestBody)
- data GenResponse a = Response {}
- type Response = GenResponse ByteString
- type StreamingResponse = GenResponse (IO ByteString)
- defaultRequest :: Request
- appendToPath :: Text -> Request -> Request
- appendToQueryString :: Text -> Maybe Text -> Request -> Request
- addHeader :: ToHttpApiData a => HeaderName -> a -> Request -> Request
- setRequestBodyLBS :: ByteString -> MediaType -> Request -> Request
- setRequestBody :: RequestBody -> MediaType -> Request -> Request
Documentation
data ServantError Source #
A type representing possible errors in a request
Note that this type substantially changed in 0.12.
Constructors
| FailureResponse Response | The server returned an error response |
| DecodeFailure Text Response | The body could not be decoded at the expected type |
| UnsupportedContentType MediaType Response | The content-type of the response is not supported |
| InvalidContentTypeHeader Response | The content-type header is invalid |
| ConnectionError Text | There was a connection error, and no response was received |
Instances
Constructors
| Request | |
Fields | |
Instances
data RequestBody Source #
The request body. A replica of the http-client RequestBody.
Constructors
| RequestBodyLBS ByteString | |
| RequestBodyBS ByteString | |
| RequestBodyBuilder Int64 Builder | |
| RequestBodyStream Int64 ((IO ByteString -> IO ()) -> IO ()) | |
| RequestBodyStreamChunked ((IO ByteString -> IO ()) -> IO ()) | |
| RequestBodyIO (IO RequestBody) |
Instances
data GenResponse a Source #
Constructors
| Response | |
Fields | |
Instances
type Response = GenResponse ByteString Source #
type StreamingResponse = GenResponse (IO ByteString) Source #
addHeader :: ToHttpApiData a => HeaderName -> a -> Request -> Request Source #
setRequestBodyLBS :: ByteString -> MediaType -> Request -> Request Source #
Set body and media type of the request being constructed.
The body is set to the given bytestring using the RequestBodyLBS
constructor.
Since: 0.12
setRequestBody :: RequestBody -> MediaType -> Request -> Request Source #
Set body and media type of the request being constructed.
Since: 0.12