http-test

Test framework for HTTP APIs

https://github.com/openbrainsrc/http-test

Latest on Hackage:0.2.5

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed by OpenBrain Ltd
Maintained by [email protected]

A simple framework for making assertions about the responses of HTTP servers.

import Test.HTTP
import Data.List (isInfixOf)

main = defaultMain $ httpTestCase "BayesHive landing page" "https://bayeshive.com" $ do
    landing <- get "/"
    assert "Correct blog link" $
      "href=\"https://bayeshive.com/blog\"" `isInfixOf` landing
    loginResult <- postForm "/auth/page/email/login"
                     [("email", "foo"), ("password", "bar")]
    debug loginResult