gdritter repos shelob / master shelob-client / example / Main.hs
master

Tree @master (Download .tar.gz)

Main.hs @masterraw · history · blame

module Main where

import qualified Network.Shelob.Client as HTTP
import qualified Network.Shelob.Types  as HTTP
import           Text.Show.Pretty

main :: IO ()
main = do
  conn <- HTTP.httpConnection "gdritter.com"

  (r0,r1,r2) <- HTTP.withConn conn $ do
    h <- HTTP.head "/index.html" [HTTP.Header "Host" "gdritter.com"]
    a <- HTTP.get "/index.html" [HTTP.Header "Host" "gdritter.com"]
    b <- HTTP.get "/matzo/matzo.html" [HTTP.Header "Host" "gdritter.com"]
    return (h, a, b)

  pPrint (r0 :: Either HTTP.HTTPError HTTP.Response)
  pPrint (r1 :: Maybe HTTP.Response)
  pPrint (r2 :: HTTP.Response)

  return ()