You check the response of the API calls currently your code does not
do this. The curl_easy_setopt returns a CURLcode. You should check and
see if this equals CURLE_OK.
When you perform the curl_easy_perform() you can check the error
message if you have set the following option CURLOPT_ERRORBUFFER.
I would really advise you to look at the examples on the website. They
lay out an easy to follow examples.
Jason
On Dec 14, 2009, at 10:19 PM, "[email protected]" <[email protected]
> wrote:
True.
But, after curl_easy_perform() is called, how do I know which out of
the following lines didn't actually work? Was there any problem with
CURLOPT_POSTFIELDS or the connection with
http://10.31.251.161:5985/wsman was not established or it didn't
accept
strHttpContent.c_str() etc.
* curl_easy_setopt(mCurl,
CURLOPT_POSTFIELDS,"user=administrator&pas=coll...@234")
* curl_easy_setopt(mCurl, CURLOPT_URL,
"http://10.31.251.161:5985/wsman")
* curl_easy_setopt(mCurl, CURLOPT_POST, 1)
* curl_easy_setopt(mCurl, CURLOPT_POSTFIELDS,
strHttpContent.c_str())
* curl_easy_setopt(mCurl, CURLOPT_POSTFIELDSIZE,
strHttpContent.length())
curl_easy_perform(mCurl)
Thanks & Regards.
Nitin
http://www.informatica.com/9
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Corcoran,
Jason
Sent: Tuesday, December 15, 2009 11:30 AM
To: libcurl development; [email protected]
Subject: RE: CURLOPT_URL returning FALSE
Yes,
You will not make a connection to the server until you call a
curl_easy_perform()
Jason.
http://www.informatica.com/9
-----Original Message-----
From: [email protected] on behalf of
[email protected]
Sent: Mon 12/14/2009 21:46
To: [email protected]
Subject: RE: CURLOPT_URL returning FALSE
Thanks for your reply.
curl_easy_setopt(curl, CURLOPT_URL , " <http://10.31.251.161:5985/wsman
>
http://10.31.251.161:5985/wsman <http://10.31.251.161:5985/wsman> ");
The above line returns 0, means successful. But, the success of above
line, I guess, doesn't indicate that connection to
http://10.31.251.161:5985/wsman <http://10.31.251.161:5985/wsman> has
actually established. This success, I think, just tells that
curl_easy_setopt has done what it was supposed to.
Am I right?
Regards.
Nitin
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html