The cookie header needs to be passed in as a single string that has the format of "Header: Value", i.e., <br><br><div style="margin-left: 40px;">(get-pure-port <url> (list <b>"Cookie: <key>=<value>; <key2>=<value2>..."</b>)) <br>
</div><br>If you need to make SSL requests, you can use my bzlib/http package's http-get, which uses list of key/value pairs as strings: <a href="http://planet.plt-scheme.org/display.ss?package=http.plt&owner=bzlib">http://planet.plt-scheme.org/display.ss?package=http.plt&owner=bzlib</a><br>
<br><div style="margin-left: 40px;">(require (planet bzlib/http/client)) <br><br>(http-get <url> `(("Cookie" . "<key>=<value>; <key2>=<value2>..."))) <br></div><br>You can of course use net/cookie to generate the the cookie header values via print-cookie. <br>
<br><a href="http://docs.plt-scheme.org/net/cookie.html#(def._((lib._net/cookie..ss)._print-cookie))">http://docs.plt-scheme.org/net/cookie.html#(def._((lib._net/cookie..ss)._print-cookie))</a><br><br>Cheers,<br>yc<br><br>
<br><div class="gmail_quote">On Tue, Dec 1, 2009 at 1:28 PM, Ralf Seliger <span dir="ltr"><<a href="mailto:admin@kreidestaub.de">admin@kreidestaub.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I want to download the contents of a certain news article using get-pure-port. I know the exact URL of the article. The site requires a session cookie to grant access to article. After registering and logging in manually via browser I have determined the name and the value of the current session cookie.<br>
<br>
Now I figure that all I have to do is call get-pure-port according to (get-pure-port URL [header]) and pass along the cookie using the optional header parameter. What I can't figure out, though, is how to put together the header such that the server accepts the cookie and grants access to the article.<br>
<br>
Any help would be appreciated.<br>
<br>
Regards,<br><font color="#888888">
<br>
Ralf Seliger<br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</font></blockquote></div><br>