Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ServantError
- = FailureResponse { }
- | DecodeFailure { }
- | UnsupportedContentType { }
- | InvalidContentTypeHeader { }
- | ConnectionError { }
- data UrlReq = UrlReq BaseUrl Req
- data Req = Req {}
- defReq :: Req
- appendToPath :: String -> Req -> Req
- appendToQueryString :: Text -> Maybe Text -> Req -> Req
- addHeader :: ToHttpApiData a => String -> a -> Req -> Req
- setRQBody :: ByteString -> MediaType -> Req -> Req
- setReqBodyLBS :: ByteString -> MediaType -> Req -> Req
- setReqBody :: RequestBody -> MediaType -> Req -> Req
- reqToRequest :: (Functor m, MonadThrow m) => Req -> BaseUrl -> m Request
- displayHttpRequest :: Method -> String
- data ClientEnv = ClientEnv {}
- newtype ClientM a = ClientM {
- runClientM' :: ReaderT ClientEnv (ExceptT ServantError IO) a
- runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
- performRequest :: Method -> Req -> ClientM (Int, ByteString, MediaType, [Header], Response ByteString)
- performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req -> ClientM ([Header], result)
- performRequestNoBody :: Method -> Req -> ClientM [Header]
- catchConnectionError :: IO a -> IO (Either ServantError a)
Documentation
data ServantError Source #
setRQBody :: ByteString -> MediaType -> Req -> Req Source #
Deprecated: Use setReqBodyLBS instead
Set body and media type of the request being constructed.
The body is set to the given bytestring using the RequestBodyLBS
constructor.
setReqBodyLBS :: ByteString -> MediaType -> Req -> Req 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.9.2.0
setReqBody :: RequestBody -> MediaType -> Req -> Req Source #
Set body and media type of the request being constructed.
Since: 0.9.2.0
reqToRequest :: (Functor m, MonadThrow m) => Req -> BaseUrl -> m Request Source #
performing requests
displayHttpRequest :: Method -> String Source #
ClientM
is the monad in which client functions run. Contains the
Manager
and BaseUrl
used for requests in the reader environment.
Monad ClientM Source # | |
Functor ClientM Source # | |
Applicative ClientM Source # | |
MonadIO ClientM Source # | |
MonadThrow ClientM Source # | |
MonadCatch ClientM Source # | |
Alt ClientM Source # | Try clients in order, last error is preserved. |
MonadBase IO ClientM Source # | |
MonadBaseControl IO ClientM Source # | |
MonadError ServantError ClientM Source # | |
MonadReader ClientEnv ClientM Source # | |
Generic (ClientM a) Source # | |
ClientLike (ClientM a) (ClientM a) Source # | |
type StM ClientM a Source # | |
type Rep (ClientM a) Source # | |
runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a) Source #
performRequest :: Method -> Req -> ClientM (Int, ByteString, MediaType, [Header], Response ByteString) Source #
performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req -> ClientM ([Header], result) Source #
catchConnectionError :: IO a -> IO (Either ServantError a) Source #