curl-users
Re: SSL, X.509 and cURL (sending XML)
Date: Wed, 18 Jul 2001 17:05:29 +1000
Armando,
I think you are trying to send your document from the curl command line
and trying to do something like:
curl --data "<?xml version="1.0">" --other-args https://blahblah/blah
If this was unix, I'd say you're being affected by the quoting rules of
your shell,
not any issue in curl. I never use windows/dos, so I can't say this is
definitely your problem here,
but here's a quick discussion based on the unix shell - I hope the hints
are useful
to you in the windows world:
The shell normally splits commands up at each white space, so the
parameter to your
'--data' argument would be <?xml without the quote marks.
Each quote matches with the next, and preserves whitespace, but is not
included as part
of the data passed to the application so the above sample passes:
<?xml version=1.0>
to your application as one string, but only because there are no spaces
inside the 1.0
bit. If you had version= " 1.0 " instead, you'd get
<?xml cersion=
and
1.0
and
>
passed as 3 separate parameters - you'd see immediately thats its
broken....
You can fix this in many ways - probably the simplest for you might be
to use 'single'
quotes around the string, assuming it doesn't have any single quotes
inside it:
curl --data '<?xml version="1.0">' --otherargs https://blahblahblah/blah
The ' match each other, and you get a single parameter with all your
spaces and quotes
intact.
An alternative is to put all your data in a file (say, input.xml ), and
pass the name of the file to curl:
curl --data @input.xml --otherargs https://blahblah/blah
Hope this helps
Cris
Received on 2001-07-18