servant-client-core-0.12: 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 Response #

Instances

Eq Response # 
Show Response # 
Generic Response # 

Associated Types

type Rep Response :: * -> * #

Methods

from :: Response -> Rep Response x #

to :: Rep Response x -> Response #

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

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