cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Kevin Martin <kevintm_at_ameritech.net>
Date: Fri, 18 Feb 2005 10:57:09 -0600

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

I'm writing a script to generate curl POST information for paging purposes...i've found that some of
the paging services I need to POST data ultimately exceed the single line shell limit in the curl
command so I'm trying use multiple -d commands seperated with a \<cr>, but it's not working..for
example, the following POST works:

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

but when I try:

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

Or

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

Or

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

Or

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

They don't work.. I was under the impression that multiple -d's would put the & between the
different form fields and create the same POST information that is passed in the first example.
I've also tried using -F in these configurations with no luck either (substituting the -d's for
- -F's). I'm sure I'm doing something very basically stupid here and any help will be greatly
appreciated.

Thanks.

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

iD8DBQFCFh5laXZlxDxYaM4RAuusAJ0b7+4jzJzcuxLDLXMW5C8sbcNzpACgyoS+
9WjZNMRV5Mj2ac9E5Q7KtT8=
=HQkE
-----END PGP SIGNATURE-----
Received on 2005-02-18