cURL / Mailing Lists / curl-library / Single Mail

curl-library

XML request posting (With example)

From: Naved Khan <navedk_at_cybage.com>
Date: Sat, 19 Apr 2003 18:50:02 +0530

Hi,

I just wanted to add one example to elaborate what i'm trying to tell below:
curl -d @url_request.txt http://www.grub.org/services/urlstats.php
(url_request.txt is attached) works just fine.

But when I try to send the XML request directly (not from file), it give the
error shown below:

D:\>curl -d "xml=<?xml
version="1.0"?><GrubService><Services>IndexedUrlInfo</ServiceName><Request><
URL>http://slashdot.org/</URL></Request></GrubService>"
http://www.grub.org/services/urlstats.php

Error:
<?xml version="1.0"?>
Bad stuff, could not parse the data, line: 1, column: 14

Also, how to send above XML request along with some name value pairs?

-------------------------------------------------------------

I'm using curl to send an XML request to an HTTPS server.

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"

Any idea what this is?? Is it something to do with curl syntax?

Basically, I want to send send some name value pairs and one XML request as
shown above. Is the above syntax correct?
Are there any examples which show using curl for http posting name value
pairs and XML request from file?

Thanks and Regards,
Naved

-------------------------------------------------------
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-20