Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- splitHttpPath :: String -> [String]
- joinHttpPath :: [String] -> String
- addJSONObject :: [Pair] -> Request -> Request
- addJSON :: ToJSON a => a -> Request -> Request
- addXML :: ByteString -> Request -> Request
- addUrlEncodedForm :: [(String, String)] -> Request -> Request
- addBody :: RequestBody -> String -> Request -> Request
- addMLS :: ByteString -> Request -> Request
- addProtobuf :: ByteString -> Request -> Request
- addHeader :: String -> String -> Request -> Request
- setCookie :: String -> Request -> Request
- getCookie :: String -> Response -> Maybe String
- addQueryParams :: [(String, String)] -> Request -> Request
- contentTypeMixed :: Request -> Request
- bindResponse :: HasCallStack => App Response -> (Response -> App a) -> App a
- withResponse :: HasCallStack => Response -> (Response -> App a) -> App a
- getBody :: HasCallStack => Int -> Response -> App ByteString
- getJSON :: HasCallStack => Int -> Response -> App Value
- assertSuccess :: HasCallStack => Response -> App ()
- assertStatus :: HasCallStack => Int -> Response -> App ()
- assertLabel :: HasCallStack => Int -> String -> Response -> App ()
- onFailureAddResponse :: HasCallStack => Response -> App a -> App a
- data Versioned
- rawBaseRequest :: (HasCallStack, MakesValue domain) => domain -> Service -> Versioned -> String -> App Request
- getAPIVersionFor :: MakesValue domain => domain -> App Int
- baseRequest :: (HasCallStack, MakesValue user) => user -> Service -> Versioned -> String -> App Request
- zUser :: String -> Request -> Request
- zProvider :: String -> Request -> Request
- zConnection :: String -> Request -> Request
- zClient :: String -> Request -> Request
- zType :: String -> Request -> Request
- zHost :: String -> Request -> Request
- submit :: String -> Request -> App Response
- locationHeaderHost :: Response -> String
- locationHeader :: Response -> Maybe (HeaderName, ByteString)
- findHeader :: HeaderName -> Response -> Maybe (HeaderName, ByteString)
- getQueryParam :: String -> String -> Maybe (Maybe String)
Documentation
splitHttpPath :: String -> [String] Source #
joinHttpPath :: [String] -> String Source #
addProtobuf :: ByteString -> Request -> Request Source #
contentTypeMixed :: Request -> Request Source #
bindResponse :: HasCallStack => App Response -> (Response -> App a) -> App a infixl 1 Source #
withResponse :: HasCallStack => Response -> (Response -> App a) -> App a 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
onFailureAddResponse :: HasCallStack => Response -> App a -> App a Source #
Instances
Generic Versioned Source # | |
type Rep Versioned Source # | |
Defined in Testlib.HTTP type Rep Versioned = D1 ('MetaData "Versioned" "Testlib.HTTP" "integration-0.1.0-3ATitUsC6IZKz3Fn68yYH1" '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 #
baseRequest :: (HasCallStack, MakesValue user) => user -> Service -> Versioned -> String -> App Request Source #
locationHeaderHost :: Response -> String Source #
locationHeader :: Response -> Maybe (HeaderName, ByteString) Source #
findHeader :: HeaderName -> Response -> Maybe (HeaderName, ByteString) Source #