[Haskell-cafe] playing around with network.curl

Paulo Tanimoto ptanimoto at gmail.com
Wed Oct 20 19:33:04 EDT 2010


Hi Michael,

On Wed, Oct 20, 2010 at 6:19 PM, Michael Litchard <michael at schmong.org> wrote:
> I'm using this tutorial as a guide
> http://flygdynamikern.blogspot.com/2009/03/extended-sessions-with-haskell-curl.html
>
> github has changed since this was posted, but I have managed a
> successful login. Now I am faced with dealing with a re-direct.
> I found this constructor
> CurlFollowLocation Bool
>
> on this page
> http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-Curl-Opts.html
>
> It seems to do what I want, But I am not clear on how to use it. Could
> someone provide an example?
>
> Thanks. End goal is to snarf the cookie that establishes the session.

I think it is what you're probably expecting.  Just add
CurlFollowLocation True to the list of options.  Those get "applied"
by setopts in main.

> opts = [ CurlCookieJar "cookies", CurlFollowLocation True ]

I've used that before with no problems.  Do you need a complete example?

Paulo


More information about the Haskell-Cafe mailing list