Skip to content

Instantly share code, notes, and snippets.

@furu
Created June 29, 2017 21:42
Show Gist options
  • Save furu/2bd6bc0b408f4f03825a7c722cad11d3 to your computer and use it in GitHub Desktop.
Save furu/2bd6bc0b408f4f03825a7c722cad11d3 to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Lazy.Char8 as L8
import Network.HTTP.Simple
main :: IO ()
main = do
resp <- httpLBS "https://httpbin.org/get"
putStrLn $ "Status: " ++ show (getResponseStatus resp)
putStrLn $ "Headers: " ++ show (getResponseHeaders resp)
L8.putStrLn $ getResponseBody resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment