| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Hreq.Core.Client.RunClient
Contents
Description
The RunClient module provides a class which any client must instantiate in order to
 run HTTP requests.
Synopsis
- class Monad m => RunClient m where
- runClient :: Request -> m Response
 - throwHttpError :: ClientError -> m a
 - checkResponse :: Request -> Response -> m (Maybe ClientError)
 
 - class Monad m => RunStreamingClient m a where
- withStreamingClient :: forall r. Request -> (a -> IO r) -> m r
 
 - data ClientPure (state :: k) a
- = RunClient Request a
 - | Throw ClientError
 
 - setHttpRequest :: Request -> ClientPure state a -> ClientPure state a
 
Documentation
class Monad m => RunClient m where Source #
Provides the capability to run a request and get a response.
Methods
runClient :: Request -> m Response Source #
throwHttpError :: ClientError -> m a Source #
checkResponse :: Request -> Response -> m (Maybe ClientError) Source #
class Monad m => RunStreamingClient m a where Source #
Methods
withStreamingClient :: forall r. Request -> (a -> IO r) -> m r Source #
Pure client
data ClientPure (state :: k) a Source #
A pure HTTP client monad useful for testing.
Constructors
| RunClient Request a | |
| Throw ClientError | 
Instances
setHttpRequest :: Request -> ClientPure state a -> ClientPure state a Source #