I'm having trouble passing header strings properly, and I'd like some advice on how to proceed. Below is a capture of what is being sent, versus what I am trying to send. I won't include all code, only what I think is necessary. If I have omitted something important, please let me know. How could I discover what the cause of the discrepancy is?<br>
Thanks again for any feedback.<br><br><br>Here's a snippet from the header, what is being sent.<br><br>> GET /resourceList.do?form=webForwardsForm&readOnly=false&policyLaunching=true&resourcePrefix=webForwards&path=%2FshowWebForwards.do&messageResourcesKey=webForwards&actionPath=%2FresourceList.do HTTP/1.1<br>
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)<br>Host: 172.16.1.18<br>Accept: */*<br>Accept-Encoding: gzip,deflate<br>Referer: <a href="https://172.16.1.18/showWebForwards.do">https://172.16.1.18/showWebForwards.do</a><br>
Cookie: domainLogonTicket=SLXa10225c6e8389b3eb181e3df5dcf08de; logonTicket=SLXa10225c6e8389b3eb181e3df5dcf08de; lbTrack=OAIAGHMWQDOLYYTJEXQHXBYPXVALXNREKIHAYYRZSOGYJLUYNNCJ--------; SSLX_SSESHID=bvgx4mggmy6v<br><br>^ compare this to CurlHttpHeaders<br>
<br>Here's the part of the source I think is relevant<br><br>> launch :: String -> String -> IO (Either String String)<br>> launch user pass = do<br>> -- Initialize Curl<br>> curl <- initCurl<br>
<br>> -- Sequence of steps<br>> let steps = do<br>> curlResp curl urlInitial method_GET<br>> curlResp curl urlLogin $ loginOpts user pass<br>> curlResp curl urlFlash1 method_GET<br>> curlResp curl urlFlash2 method_GET<br>
> curlResp curl urlGetResource resourceOpts <---- here's where the problem is revealed<br><br>> runErrorT steps<br>> main :: IO ()<br>> main = do<br>> -- username and password<br>> user:pass:_ <- getArgs<br>
<br>> -- Launch webpage<br>> resp <- launch user pass<br><br>> -- Response comes as Either String String<br>> -- You have to handle each case<br>> case resp of<br>> Left err -> print err<br>
> Right body -> putStrLn body<br><br><br><br>> resourceOpts :: [CurlOption]<br>> resourceOpts =<br>> [ CurlHttpHeaders<br>> [ "Accept text/javascript, text/html, application/xml, text/xml, */*"<br>
> , "Accept-Language en-us,en;q=0.5"<br>> , "Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7"<br>> , "Keep-Alive 115"<br>> , "Connection keep-alive"<br>
> , "X-Requested-With XMLHttpRequest"<br>> , "X-Prototype-Version 1.6.0.3"<br>> ]<br>> , CurlEncoding "gzip,deflate"<br>> , CurlReferer "<a href="https://172.16.1.18/showWebForwards.do">https://172.16.1.18/showWebForwards.do</a>"<br>
> ]<br><br><br>