cURL / Mailing Lists / curl-users / Single Mail

curl-users

[Fwd: Easy "POST" question but cannot figure it out!!]

From: <jon_at_linertia.com>
Date: Wed, 14 Nov 2007 11:23:52 -0800 (PST)

sorry I had a typo in the last post. The command line is actually:

curl -c cookie -d
"email=email%40email.com&password=pass&login=Log+in"
www.example.com/index.html

---------------------------- Original Message ----------------------------
Subject: Easy "POST" question but cannot figure it out!!
From: jon_at_linertia.com
Date: Wed, November 14, 2007 11:06 am
To: curl-users_at_cool.haxx.se
--------------------------------------------------------------------------

Hi all,

Here is the very very simple form that I am trying to automate login to:

<form method="post" action="">
<h2>Please enter your email address and password</h2>
<p>Email: <input type="text" name="email" maxlength="255" />&nbsp;
Password: <input type="password" name="password" />
<input type="submit" name="login" value="Log in" />
</p>
<p><input type="checkbox" name="remember_me" /> Remember Me</p>
</form>

I also changed the method of POST to GET (to see what is posted to the
server) and the results are:

www.example.com/index.html?email=email%40email.com&password=pass&login=Log+in

so now that I know what data is being sent, I use the following command line:

curl -c cookie -d
"/index.html?email=email%40email.com&password=pass&login=Log+in"
www.example.com/index.html

For some reason, this does NOT work! I use the verbose option in curl and
this is what I see in one of the lines:

email=email%40email.com&password=pass&login=Log+in< HTTP/1.1 404 Not Found

Anybody have any ideas? You guys are great!
Received on 2007-11-14