-- | perform a GET on the query and return the response string
httpGET :: String -> IO String
httpGET uri = do
  case parseURI uri of
    Nothing -> error $ printf "httpGET: uri malformed: ``%s''" uri
    Just u  -> do
                resp <- simpleHTTP (Request u GET [] "")
                case resp of
                  Left err -> error $ printf "httpGET: failed query: ``%s''" uri
                  Right (Response _ _ _ body) -> return body
httpGET :: String -> IO String
httpGET uri = do
  case parseURI uri of
    Nothing -> error $ printf "httpGET: uri malformed: ``%s''" uri
    Just u  -> do
                resp <- simpleHTTP (Request u GET [] "")
                case resp of
                  Left err -> error $ printf "httpGET: failed query: ``%s''" uri
                  Right (Response _ _ _ body) -> return body
httpGET uri = do
  case parseURI uri of
    Nothing -> error $ printf "httpGET: uri malformed: ``%s''" uri
    Just u  -> do
                resp <- simpleHTTP (Request u GET [] "")
                case resp of
                  Left err -> error $ printf "httpGET: failed query: ``%s''" uri
                  Right (Response _ _ _ body) -> return body