Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
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 #
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.
Instances
setHttpRequest :: Request -> ClientPure state a -> ClientPure state a Source #