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

From: Chognkai Zhu (czhu at cs.utah.edu)
Date: Fri Feb 12 18:13:21 EST 2010

Hi,

Here is a from from some website:

      <form name="ua" action="/" method="post">
      <input type="hidden" name="redirect" value="/?dnode=State">

      <table>

        
        <tr align="left" valign="middle" bgcolor="#ffffff">
          <td><B>Username:</B><BR><input name="username" type="text" 
size="15"></td>
          <td><B>Password:</B><BR><input name="password" type="password" 
size="15"></td>
          <td valign="bottom"><input type="submit" value="Login"></td>
        </tr>
        <tr>
          <td colspan="2">
            <p style="font-size: 12pt; margin-top: 10px;">
              <a href="/?dnode=pass">Forget your password?</a>
            </p>
          </td>
      </table>
      </form>

I need a program to submit this form. I tried

(post-impure-port
   (string->url "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.

Chongkai



Posted on the users mailing list.