curl-library
RE: XML request posting
Date: Mon, 21 Apr 2003 10:43:24 +0530
Hi,
I am using the Win2K pro command prompt to execute curl command. For that we
need to use single quotes, within the outer double quotes of the string. It
works fine!
Thanks a lot,
Naved
-----Original Message-----
From: Bjorn Reese [mailto:breese_at_mail1.stofanet.dk]
Sent: Saturday, April 19, 2003 7:04 PM
To: curl-library_at_lists.sourceforge.net
Subject: Re: XML request posting
Naved Khan wrote:
> curl -v --header "Content-type: text/xml" -d
>
"Servername=abc&Username=XXX&Password=xxx&AcknowledgementTo=abc_at_xyz.com&XML=
> <?xml version = "1.0" encoding = "UTF-8"?><!DOCTYPE Naved SYSTEM
>
"Naved.dtd"><Connect><GetObjNames><Depth>CAMP</Depth><ClientName>Orbit</Clie
> ntName></GetObjNames></Connect>" https://server/myconnect.exe -k
>
> I get the following error from the server side XML (Xerces) parser:
> "Error: Expected quoted string"
I believe that your problem is a command-prompt/shell problem.
Your XML document contains quotes. The command-prompt cannot distinguish
between the quotes in your document and the surrounding quotes for the
-d argument. It will therefore terminate the document at the first embedded
quote (after ''<?xml version = ''.)
The solution is to escape the embedded quotes. Exactly how this must be
done depends on your command-prompt. However, a good guess is to preceed
every embedded quote with a backslash, i.e. ''<?xml version = \"1.0\"''.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-21