[Haskell-cafe] Wreq: use basic auth and also change the response timeout

Carlo Hamalainen carlo at carlo-hamalainen.net
Mon Oct 6 07:59:25 UTC 2014


Hi,

I am using Wreq with basic authentication. I also want to change the
response timeout. The following code compiles but the user
authentication fails:

import Network.HTTP.Client (defaultManagerSettings, managerResponseTimeout)

opts = defaults & manager .~ Left (defaultManagerSettings {
managerResponseTimeout = Just 3000000000 } )
                         & auth .~ basicAuth "user" "pass"

Perhaps I'm not using the lens onto the manager correctly?

If I use just

opts = defaults & auth .~ basicAuth "user" "pass"

then my program runs fine. But I need the longer timeout for some large
downloads.

Thanks,

--
Carlo Hamalainen
http://carlo-hamalainen.net



More information about the Haskell-Cafe mailing list