cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: curl with multiple -d's not working as I expect.

From: Kevin Martin <kevinm_at_netfuel.com>
Date: Tue, 22 Feb 2005 08:43:05 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kevin,

~ The extra dashes got in there from my mail client somehow...they aren't in the script.

~ The example you included below is my last example of the didn't work group. The man page for curl
actually shows the use of multiple -d's as such:

Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks
like 'name=daniel&skill=lousy'.

Don't know if the single ' before the 1st -d and after the work lousy are supposed to indicate
wrapping multiple -d's within quotes or not...a little confusing in that case.

Anyway, I figured out the putting \ immediately after each & will allow me to split long lines and
still have the script post correctly (my mistake was having a space between the & and the \ as it
turned out).

Thanks for the input and the reply...never was able to get multiple -d's working.

Thanks again.

Kevin Martin

Date: Fri, 18 Feb 2005 12:34:29 -0500
From: "Roth, Kevin P." <kproth_at_mapllc.com>
Subject: RE: curl with multiple -d's not working as I expect.
To: "curl tool talk" <curl-users_at_cool.haxx.se>

Each -d is a separate argument. Don't wrap them all inside one set of
quotes, but rather wrap EACH one in quotes.

Like this:

curl -v \
- - -d "txtNum=9876543210" \
- - -d "txtFrom=kevintm%40blah.com" \
- - -d "txtMessage=Help.+Im+caught+in+a+vortex." \
- - -d "hdnpublic=1" \
- - -d "msgTermsUse=on" www.t-mobile.com/messaging/default.asp

Also, why the extra (?) "-"'s at the beginning of each line? Is that a
shell thing? curl.exe doesn't need it...

- - Kevin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCG0T4aXZlxDxYaM4RAqI6AKDhEkZn7EyDw1I2ym955Ql9q43fGwCgrBlI
xu7eDxrUTQZDUGDnWG5aBYk=
=bI7q
-----END PGP SIGNATURE-----
Received on 2005-02-22