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