LibCurl - HTTP response code capture

Hello everyone !!

After running

res = curl.SendRequestStr(xferinfo.Url, xferinfo.PostParams, respBuffer)

how do I get the HTTP response code (200 OK, 404 Not Found, 500 Internal Server Error, etc.)?

thank you

curl.SetOpt(CURLOPT_HEADER, TRUE)

…will return the header which you can do what you want with.

1 Like

Hi ! Just ask for the response code after the request.

res = curl.SendRequestStr(xferinfo.Url, xferinfo.PostParams, respBuffer)

If res = CURLE_OK
   MyResponseCode = Curl.GetResponseCode()
   Message(MyResponseCode)
end
1 Like

thank you so much !!