Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ServantError
- = FailureResponse { }
- | DecodeFailure { }
- | UnsupportedContentType { }
- | InvalidContentTypeHeader { }
- | ConnectionError { }
- 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
- 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 #
reqToRequest :: (Functor m, MonadThrow m) => Req -> BaseUrl -> m Request Source #
performing requests
displayHttpRequest :: Method -> String 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 #