curl-users
HTTP Post and Curl
Date: Tue, 10 Jun 2003 07:43:13 -0400
Hi all ,
Sorry to bother you again .
Here the sample i build looking through the documentation to create my one
Header and the body and post it using Curl ;
?***************************************************************************
*******
curl = curl_easy_init();
struct curl_slist *headers=NULL;
headers = curl_slist_append(headers, "POST /servlets/CelerraManager
HTTP/1.0");
headers = curl_slist_append(headers, "Host: XXX.24.179.XX:8000");
headers = curl_slist_append(headers, "Content-Type: text/xml");
headers = curl_slist_append(headers, "Content-Length: 388");
headers = curl_slist_append(headers, "EMCXMPUser: XXXXXXXX");
headers = curl_slist_append(headers, "EMCXMPAction: mtr");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS,total.c_str() );
int size = total.size();
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, size);
int test = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
I am getting all the time error code 3 which is "The URL was not properly
formatted" .
Do you have any idea what might happend Do i use correct functions for
seting up my own header and send binary format the body ?
Where total =
<?xml version="1.0" encoding="UTF-8"?>
<Packet xmlns="http://www.emc.com/schemas/celerra/xsd_v2.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.emc.com/schemas/celerra/xsd_v2.3
C:\PROJECTS\CMGR_XML\XSD\xhmp_request.xsd">
<User un="nasadmin" pw="nasadmin" close="true" />
<Request handle="12346">
<ControlStation>
<Config/>
</ControlStation>
</Request>
</Packet>
Best regards Misha .
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
Received on 2003-06-10