sydtest-wai-0.2.0.1: A wai companion library for sydtest
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Syd.Wai.Request

Synopsis

Documentation

get :: ByteString -> WaiSession st (Response ByteString) Source #

Perform a GET request to the application under test.

post :: ByteString -> ByteString -> WaiSession st (Response ByteString) Source #

Perform a POST request to the application under test.

put :: ByteString -> ByteString -> WaiSession st (Response ByteString) Source #

Perform a PUT request to the application under test.

patch :: ByteString -> ByteString -> WaiSession st (Response ByteString) Source #

Perform a PATCH request to the application under test.

options :: ByteString -> WaiSession st (Response ByteString) Source #

Perform an OPTIONS request to the application under test.

delete :: ByteString -> WaiSession st (Response ByteString) Source #

Perform a DELETE request to the application under test.

request :: Method -> ByteString -> [Header] -> ByteString -> WaiSession st (Response ByteString) Source #

Perform a request to the application under test, with specified HTTP method, request path, headers and body.

performRequest :: Request -> WaiSession st (Response ByteString) Source #

Perform a bare Request.

You can use this to make a request to an application other than the one under test. This function does not set the host and port of the request like request does, but it does share a CookieJar.

shouldRespondWith :: HasCallStack => WaiSession st (Response ByteString) -> ResponseMatcher -> WaiExpectation st Source #

Make a test assertion using a ResponseMatcher on the Response produced by the given action

This function is provided for backward compatibility with wai-test but this approach has been made obsolete by the way sydtest does things. You should use shouldBe based on the responses that you get from functions like get and post instead.