[Haskell-cafe] Two GET HTTP requests

Chris Eidhof chris at eidhof.nl
Fri Feb 5 12:51:38 EST 2010


Hi everyone,

I'm trying to do a number of successive HTTP requests in one program. Here's what I tried:

Approach 1: I used the 'download' package, which failed to install on OS X. It fails with "error: libio.h: No such file or directory".

Approach 2: I installed the 'download-curl' package, and tried again. This seems to fail on the following example:

> import Network.Curl.Download
> 
> main = do x <- openURI "http://haskell.org"
>           y <- openURI "http://haskell.org/hoogle"
>           return ()

If I put a print statement around the second line of the do-statement it looks like openURI never returns.

Approach 3: I used the simpleHTTP function from the HTTP package. This crashed, after I dug a little deeper into the code, it threw an error on calling the parseURI function (openFile: no such file exists). I installed the latest network package and upgraded my HTTP package, and the parseURI error went away. I felt like I was almost there, and tried the following:

> simpleHTTP (getRequest "http://haskell.org")

This failed with just the text "Bus error". I searched the HTTPBis git repository, but couldn't find the text "Bus error". I don't have a clue of how to fix this.

I'm a bit stuck here, I would love to help fix the errors, but don't know what would be the best place to begin. If anyone can point me in the right direction, I will try to patch at least one of these packages.

Thanks,

-chris



More information about the Haskell-Cafe mailing list