Created
March 28, 2014 20:52
-
-
Save bos/9842762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basicPost = do | |
r <- post "http://httpbin.org/post" (binary "wibble") >>= json | |
let body = r^.responseBody :: Value | |
assertEqual "POST succeeds" status200 (r ^. responseStatus) | |
assertEqual "POST echoes input" (Just "wibble") (body ^? key "data") | |
assertEqual "POST is binary" (Just "application/octet-stream") | |
(body ^? key "headers" . key "Content-Type") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment