cURL / Mailing Lists / curl-library / Single Mail

curl-library

Query in curl library behavior when curl_easy_perform fails

From: Ramachandran, Agalya (Contractor) <Agalya_Ramachandran_at_comcast.com>
Date: Fri, 10 Jun 2016 14:02:02 +0000

Hi team,

I have a question regarding curl library behavior with respect to curl_easy_perform API call.
Here is the snippet of the code that am using in "rest_put" API call.

  w_curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_func);
 w_curl_easy_setopt(handle, CURLOPT_WRITEDATA, &res_body);

When curl_easy_perform API call is success, I could able to retrieve the result body from the res_body.
But in the case of API call failure am not getting any details of the message. But getting only the http response code.
Is there a way to get the message details as well in the case where curl_easy_perform API fails?

LM_INFO(" Actual result body is %s\n", res_body.s);
When I print this, in the case of success, am getting a http response message in detail.
But in case of failure it only returns error code.

Please guide me if there is a way to the message details in case of failure too.

Regards,
Agalya

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-06-10