cURL / Mailing Lists / curl-users / Single Mail

curl-users

-d in multiple parts

From: Kevin P Roth <KPRoth_at_MarathonOil.com>
Date: Wed, 25 Oct 2000 15:50:39 -0500

It seems that only the last -d string in a curl command line gets used. Is that by design? If so, could someone brief me on why? If not, is there a bug somewhere?

For example, consider the following two examples:

1) curl -d "a=1&b=2" http://testweb/formvars.asp
2) curl -d a=1 -d b=2 http://testweb/formvars.asp

formvars.asp just prints back all the form variables that came in with the request, so #1 shows me both a and b, while #2 only shows me b.

The reason I want to separate into two parts is this: I have a form request I use, in which all of about 30 different form fields remain unchanged from one request to the other, while one of those fields is different on each request. So I'd like to store the 29 fields that never change in a config file and use it via -K, while I'd like to put the one fields that's different directly onto the command line, as in:

3) curl -K standardfields.txt -d 30thfield=something http://testweb/formvars.asp

For now, I'm getting by with a -d argument for the 29 fields, and tacking the 30th on as part of the URL, as in:

4) curl -K standardfields.txt http://testweb/formvars.asp?30thfield=something

however since I don't control the web page at the other end of this, they could at any point change their logic so this hack breaks...

Thanks,
--Kevin
Received on 2000-10-25