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

Safe HaskellNone
LanguageHaskell2010

Servant.Client.Core.Internal.Request

Synopsis

Documentation

data ServantError #

A type representing possible errors in a request

Note that this type substantially changed in 0.12.

Constructors

FailureResponse Response

The server returned an error response

DecodeFailure Text Response

The body could not be decoded at the expected type

UnsupportedContentType MediaType Response

The content-type of the response is not supported

InvalidContentTypeHeader Response

The content-type header is invalid

ConnectionError Text

There was a connection error, and no response was received

Instances

Eq ServantError # 
Show ServantError # 
Generic ServantError # 

Associated Types

type Rep ServantError :: * -> * #

Exception ServantError # 
type Rep ServantError # 

data RequestF a #

Instances

Functor RequestF # 

Methods

fmap :: (a -> b) -> RequestF a -> RequestF b #

(<$) :: a -> RequestF b -> RequestF a #

Eq a => Eq (RequestF a) # 

Methods

(==) :: RequestF a -> RequestF a -> Bool #

(/=) :: RequestF a -> RequestF a -> Bool #

Show a => Show (RequestF a) # 

Methods

showsPrec :: Int -> RequestF a -> ShowS #

show :: RequestF a -> String #

showList :: [RequestF a] -> ShowS #

Generic (RequestF a) # 

Associated Types

type Rep (RequestF a) :: * -> * #

Methods

from :: RequestF a -> Rep (RequestF a) x #

to :: Rep (RequestF a) x -> RequestF a #

type Rep (RequestF a) # 

data GenResponse a #

Instances

Functor GenResponse # 

Methods

fmap :: (a -> b) -> GenResponse a -> GenResponse b #

(<$) :: a -> GenResponse b -> GenResponse a #

Foldable GenResponse # 

Methods

fold :: Monoid m => GenResponse m -> m #

foldMap :: Monoid m => (a -> m) -> GenResponse a -> m #

foldr :: (a -> b -> b) -> b -> GenResponse a -> b #

foldr' :: (a -> b -> b) -> b -> GenResponse a -> b #

foldl :: (b -> a -> b) -> b -> GenResponse a -> b #

foldl' :: (b -> a -> b) -> b -> GenResponse a -> b #

foldr1 :: (a -> a -> a) -> GenResponse a -> a #

foldl1 :: (a -> a -> a) -> GenResponse a -> a #

toList :: GenResponse a -> [a] #

null :: GenResponse a -> Bool #

length :: GenResponse a -> Int #

elem :: Eq a => a -> GenResponse a -> Bool #

maximum :: Ord a => GenResponse a -> a #

minimum :: Ord a => GenResponse a -> a #

sum :: Num a => GenResponse a -> a #

product :: Num a => GenResponse a -> a #

Traversable GenResponse # 

Methods

traverse :: Applicative f => (a -> f b) -> GenResponse a -> f (GenResponse b) #

sequenceA :: Applicative f => GenResponse (f a) -> f (GenResponse a) #

mapM :: Monad m => (a -> m b) -> GenResponse a -> m (GenResponse b) #

sequence :: Monad m => GenResponse (m a) -> m (GenResponse a) #

Eq a => Eq (GenResponse a) # 
Show a => Show (GenResponse a) # 
Generic (GenResponse a) # 

Associated Types

type Rep (GenResponse a) :: * -> * #

Methods

from :: GenResponse a -> Rep (GenResponse a) x #

to :: Rep (GenResponse a) x -> GenResponse a #

type Rep (GenResponse a) # 
type Rep (GenResponse a) = D1 * (MetaData "GenResponse" "Servant.Client.Core.Internal.Request" "servant-client-core-0.13-4nqssFtl3kS19RA9az41o4" False) (C1 * (MetaCons "Response" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "responseStatusCode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Status)) (S1 * (MetaSel (Just Symbol "responseHeaders") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Seq Header)))) ((:*:) * (S1 * (MetaSel (Just Symbol "responseHttpVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HttpVersion)) (S1 * (MetaSel (Just Symbol "responseBody") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)))))

newtype StreamingResponse #

Constructors

StreamingResponse 

Fields

appendToQueryString #

Arguments

:: Text

param name

-> Maybe Text

param value

-> Request 
-> Request 

setRequestBodyLBS :: ByteString -> MediaType -> Request -> Request #

Set body and media type of the request being constructed.

The body is set to the given bytestring using the RequestBodyLBS constructor.

Since: 0.12

setRequestBody :: RequestBody -> MediaType -> Request -> Request #

Set body and media type of the request being constructed.

Since: 0.12