How to get http status code directly into a variable in cURL lib?

551 Views Asked by At

I know curl_easy_getinfo function can be used to get the http status code. Is there anyway to set a variable (curl_easy_setopt) and read value directly from it after performing the request?

1

There are 1 best solutions below

0
On BEST ANSWER

No, you use curl_easy_getinfo() to extract information from the previous transfer. Even for HTTP response codes: CURLINFO_RESPONSE_CODE.