cURL / Mailing Lists / curl-users / Single Mail

curl-users

Using cURL to post a form to a DYNAMIC url action?

From: Scott Taylor <scott_at_sterling-gaming.com>
Date: Fri, 11 May 2007 20:29:57 -0400

This problem is related to using cURL to post a form, where the ACTION url
is a dynamic one! That is, the **action** is:
http://www.foo.com/index.php?user=sst&action=smile

(as in <form action=http://www.foo.com/index.php?user=sst&action=smile
method=post>)

But then there is form data that needs to be passed to that form.

(as in Telephone=704 City=charlotte)

I'd have thought it to work lke this:
Curl http://www.foo.com/index.php -d user=sst -d action=smile -d
telephone=704 -d city=charlotte

But that fails. It appears that the data that goes along in the URL
(user=sst&action=smile) gets lost somehow, or that the whole works gets
posted to a non-existent place.

Neither:
Curl http://www.foo.com/index.php%3ftelephone=7042&city=charlotte
Nor:
Curl http://www.foo.com/index.php%3ftelephone=704%26city=charlotte
Work, as the URLs are unrecognized by the server. I didn't bother re-typing
the "-d" stuff there, since it won't get that far anyway with unrecognized
URLs.

I do not know how you are supposed to POST to something that has name=value
arguments in the URL. I thought that was the definition of a GET! So, Iım
absolutely clueless and frustrated.

Please let me know if you have any suggestions, please!

Best regards,

Scott
Received on 2007-05-12