curl_easy_getinfo()
function that allows an application to query libcurl for information from the previously performed transfer.curl_easy_getinfo()
like this:CURLOPT_FAILONERROR
option that if set instructs curl to return CURLE_HTTP_RETURNED_ERROR
in this case. It will then return error as soon as possible and not deliver the response body.