integration-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Testlib.HTTP

Synopsis

Documentation

bindResponse :: HasCallStack => App Response -> (Response -> App a) -> App a infixl 1 Source #

getBody :: HasCallStack => Int -> Response -> App ByteString Source #

Check response status code, then return body.

getJSON :: HasCallStack => Int -> Response -> App Value Source #

Check response status code, then return JSON body.

assertSuccess :: HasCallStack => Response -> App () Source #

assert a response code in the 2** range

assertStatus :: HasCallStack => Int -> Response -> App () Source #

assert a response status code

assertLabel :: HasCallStack => Int -> String -> Response -> App () Source #

assert a failure with some failure code and label

data Versioned Source #

Instances

Instances details
Generic Versioned Source # 
Instance details

Defined in Testlib.HTTP

Associated Types

type Rep Versioned :: Type -> Type #

type Rep Versioned Source # 
Instance details

Defined in Testlib.HTTP

type Rep Versioned = D1 ('MetaData "Versioned" "Testlib.HTTP" "integration-0.1.0-1M0hVX0XSYq1OAOo8LJGGB" 'False) (C1 ('MetaCons "Versioned" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Unversioned" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExplicitVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

rawBaseRequest :: (HasCallStack, MakesValue domain) => domain -> Service -> Versioned -> String -> App Request Source #

If you don't know what domain is for or what you should put in there, try `rawBaseRequest OwnDomain ...`.

getAPIVersionFor :: MakesValue domain => domain -> App Int Source #