Skip to content

Instantly share code, notes, and snippets.

@bos

bos/BasicPost.hs

Created Mar 28, 2014
Embed
What would you like to do?
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