cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: https/post help

From: Jared Ingersoll <jared_at_cswv.com>
Date: Thu, 31 Jul 2003 08:33:55 -0400

No the data.txt is URL encoded, so there is no -G, only % signs, numbers and
letters:

%3Ccasa%3E%3Caccount%3E%3Ccustomerid%3E1000%3C%2Fcustomerid%3E%3Cuserid%3E49
%3C%2Fuserid%3E%3C%2Faccount%3E%3Cproperty%3E%3Cpropstreet%3E18808%20oldhome
stead%3C%2Fpropstreet%3E%3Cpropunit%3E%3C%2Fpropunit%3E%3Cpropcity%3Eharper%
20woods%3C%2Fpropcity%3E%3Cpropstate%3EMi%3C%2Fpropstate%3E%3Cpropzip%3E4822
5%3C%2Fpropzip%3E%3Cproptype%3E%3C%2Fproptype%3E%3C%2Fproperty%3E%3Coptional
%3E%3Ctracking%3E%3Ctracknum%3E987654321%3C%2Ftracknum%3E%3Ctrackname%3EJohn
%20Smith%3C%2Ftrackname%3E%3C%2Ftracking%3E%3C%2Foptional%3E%3C%2Fcasa%3E

I won't always be passing the data from the command line, so that's why I
have the data reassigned to a variable in the script %1 will eventually be
something else.

-jared

-----Original Message-----
From: Roth, Kevin P. [mailto:KPRoth_at_MAPLLC.com]
Sent: Thursday, July 31, 2003 8:25 AM
To: curl-users_at_lists.sourceforge.net
Subject: RE: https/post help

Could there be a -G somewhere in your data.txt file? If it ended up in just
the right place, I suppose it could have triggered curl's '--get' mode,
where -d (POST) request gets turned into a GET request instead...

I believe your script is slightly flawed though. Instead of:

  data=`cat $1`
  ...
  curl ... -d "@$data"

I think you actually need:

  curl ... -d "@$1"

The @-sign tells curl to do the reading from the file, so your cat command
is unnecessary.

You might also need to use --data-binary (if you require preserving newlines
and other less-than-printable characters).

- Kevin

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-07-31