cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Posting HTTP Message via a file through --data-ascii

From: Nivedan Nadaraj <nnadaraj_at_erggroup.com>
Date: Thu, 8 Jun 2006 15:38:38 +0800

Hi Ralph,

Thank you, this worked. I provided in my configuration file as
--data-ascii=@thefilename
When we invoke from the shell script we can do ./curl --config
./myconfigfile.txt

Option 2
Another way to do the same thing was to assign the content of the file (if
its seems sensible) into a Shell Variable.
$ MY_VAR="test data";
And invoke ./curl --data-ascii="$MY_VAR" --config ./myconfigfile.txt

Thank you all,

Nivedan Nadaraj

"Ralph Mitchell" <ralphmitchell_at_gmail.com>
Sent by: curl-users-bounces_at_cool.haxx.se
08/06/2006 12:05 PM
Please respond to
the curl tool <curl-users_at_cool.haxx.se>

To
"the curl tool" <curl-users_at_cool.haxx.se>
cc

Subject
Re: Posting HTTP Message via a file through --data-ascii

According to the man page:

   "If you start the data with the letter @, the rest should be a file
name to read the data from"

So, --data-ascii="@filename" ought to do it.

Ralph Mitchell

On 6/7/06, Nivedan Nadaraj <nnadaraj_at_erggroup.com> wrote:

Hi all,

I need to post a chunk of data i.e a HTTP message content across. Using
--data-ascii I am able to do that by pasting the chunk of data.
However if I needed to do the same by having the chunk of data in a text
file, how would I be able to do that ?

e.g --data-ascii="<xml-root><sometag>55</sometag></xmlroot>" // This
works

e.g --data-ascii= ?? Can I specify a way to indicate where to pick the
content from ?

Any help appreciate
Thanks

Nivedan Nadaraj
Received on 2006-06-08