Skip to content

Instantly share code, notes, and snippets.

@bos
Created March 28, 2014 20:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bos/9842762 to your computer and use it in GitHub Desktop.
Save bos/9842762 to your computer and use it in GitHub Desktop.
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