Commits

Cédric Bonhomme  committed 072cf61 Draft

First commit. Just a test of Haskell HTTP client.

  • Participants

Comments (0)

Files changed (1)

+module HTTPExample
+where
+
+import Network.HTTP -- SimpleHTTP
+
+
+url <- "http://photos.cedricbonhomme.org/photos/list.json?pageSize=1000"
+
+-- Fetch a URL via GET
+fetch :: String -> IO String
+fetch url = do
+  response <- simpleHTTP (getRequest url)
+  body <- getResponseBody response
+  return body
+
+main = do
+  fetch url