servant-client-core-0.20.3.0: Core functionality and class for client function generation for servant APIs

Safe Haskell | None
Language | Haskell2010

Servant.Client.Core.RunClient

Description

Types for possible backends to run client-side `Request` queries

Synopsis

- class Monad m => RunClient (m :: Type -> Type) where
  - runRequestAcceptStatus :: Maybe [Status] -> Request -> m Response
  - throwClientError :: ClientError -> m a
- runRequest :: RunClient m => Request -> m Response
- class RunClient m => RunStreamingClient (m :: Type -> Type) where
  - withStreamingRequest :: Request -> (StreamingResponse -> IO a) -> m a
- data ClientF a
  - = RunRequest Request (Response -> a)
  - | Throw ClientError

# Documentation

class Monad m => RunClient (m :: Type -> Type) where Source #

Methods

runRequestAcceptStatus :: Maybe [Status] -> Request -> m Response Source #

How to make a request, with an optional list of status codes to not throw exceptions for (default: [200..299]).

throwClientError :: ClientError -> m a Source #

#### Instances

Instances details

ClientF ~ f => RunClient (Free f) Source # |
Instance details Defined in Servant.Client.Core.RunClient Methods runRequestAcceptStatus :: Maybe [Status] -> Request -> Free f Response Source # throwClientError :: ClientError -> Free f a Source #

runRequest :: RunClient m => Request -> m Response Source #

How to make a request.

class RunClient m => RunStreamingClient (m :: Type -> Type) where Source #

Methods

withStreamingRequest :: Request -> (StreamingResponse -> IO a) -> m a Source #

data ClientF a Source #

`ClientF` cannot stream.

Compare to `RunClient`.

Constructors

RunRequest Request (Response -> a) |
Throw ClientError |

#### Instances

Instances details

Functor ClientF Source # |
Instance details Defined in Servant.Client.Core.RunClient Methods fmap :: (a -> b) -> ClientF a -> ClientF b Source # (<$) :: a -> ClientF b -> ClientF a Source #