Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Hreq m a = Hreq {
- runHreq' :: ReaderT HttpConfig m a
- class Monad m => RunClient (m :: Type -> Type) where
- runClient :: Request -> m Response
- throwHttpError :: ClientError -> m a
- checkResponse :: Request -> Response -> m (Maybe ClientError)
- runHreq :: MonadIO m => BaseUrl -> Hreq m a -> m a
- runHreqWithConfig :: HttpConfig -> Hreq m a -> m a
- runHttpClient :: (MonadReader HttpConfig m, MonadIO m, RunClient m) => Request -> m Response
- checkHttpResponse :: MonadReader HttpConfig m => Request -> Response -> m (Maybe ClientError)
- requestToHTTPRequest :: BaseUrl -> Request -> Request
- httpResponsetoResponse :: (a -> b) -> Response a -> ResponseF b
- catchConnectionError :: IO a -> IO (Either ClientError a)
Hreq monad
Monad for running Http client requests
Hreq | |
|
Instances
MonadTrans Hreq Source # | |
Defined in Hreq.Client.Internal.HTTP | |
Monad m => MonadReader HttpConfig (Hreq m) Source # | |
Defined in Hreq.Client.Internal.HTTP ask :: Hreq m HttpConfig # local :: (HttpConfig -> HttpConfig) -> Hreq m a -> Hreq m a # reader :: (HttpConfig -> a) -> Hreq m a # | |
Monad m => Monad (Hreq m) Source # | |
Functor m => Functor (Hreq m) Source # | |
Applicative m => Applicative (Hreq m) Source # | |
MonadIO m => MonadIO (Hreq m) Source # | |
Defined in Hreq.Client.Internal.HTTP | |
MonadUnliftIO m => MonadUnliftIO (Hreq m) Source # | |
Defined in Hreq.Client.Internal.HTTP | |
RunClient (Hreq IO) Source # | |
Defined in Hreq.Client.Internal.HTTP |
class Monad m => RunClient (m :: Type -> Type) where #
runClient :: Request -> m Response #
throwHttpError :: ClientError -> m a #
checkResponse :: Request -> Response -> m (Maybe ClientError) #
Running Hreq
runHreqWithConfig :: HttpConfig -> Hreq m a -> m a Source #
runHttpClient :: (MonadReader HttpConfig m, MonadIO m, RunClient m) => Request -> m Response Source #
Helper functions
checkHttpResponse :: MonadReader HttpConfig m => Request -> Response -> m (Maybe ClientError) Source #
requestToHTTPRequest :: BaseUrl -> Request -> Request Source #
httpResponsetoResponse :: (a -> b) -> Response a -> ResponseF b Source #