Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ServantError
- data RequestF a = Request {}
- type Request = RequestF Builder
- newtype RequestBody = RequestBodyLBS ByteString
- data GenResponse a = Response {}
- type Response = GenResponse ByteString
- newtype StreamingResponse = StreamingResponse {
- runStreamingResponse :: forall a. (GenResponse (IO ByteString) -> IO a) -> IO a
- 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.
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 |
newtype RequestBody Source #
The request body. Currently only lazy ByteStrings are supported.
data GenResponse a Source #
Functor GenResponse Source # | |
Foldable GenResponse Source # | |
Traversable GenResponse Source # | |
Eq a => Eq (GenResponse a) Source # | |
Show a => Show (GenResponse a) Source # | |
Generic (GenResponse a) Source # | |
type Rep (GenResponse a) Source # | |
type Response = GenResponse ByteString Source #
newtype StreamingResponse Source #
StreamingResponse | |
|
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