[plt-scheme] question about HTTP POST with post-impure-port/post-pure-port

From: YC (yinso.chen at gmail.com)
Date: Fri Feb 12 18:39:25 EST 2010

On Fri, Feb 12, 2010 at 3:13 PM, Chognkai Zhu <czhu at cs.utah.edu> wrote:

>
> (post-impure-port
>  (string->url "http://XXXX/?redirect=%2F%3Fdnode%3DState<http://xxxx/?redirect=%2F%3Fdnode%3DState>
> ")
>  #"username=XXXX&password=XXXX"))
>
> Where XXXX is either the host(url) or the username/password(in URL
> encoding). But it doesn't seems to work. The returned page is still the page
> with the form asking for username/password. What part did I miss? Could
> anyone who know these things please help? Many thanks.


 It mostly looked right except for the redirect field.  Depending on the
server side it might not look for a post value from the query string.

Try to put it into the bytes like:

(post-impure-port (string->url "http://xxx..
.")  #"redirect=%2f#3fdnode%3dState&username=xxx&password=...")

And see if that helps,

Cheers.
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100212/43e40855/attachment.html>

Posted on the users mailing list.