-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Trivial
-
None
-
Affects Version/s: 7.0.22
-
Component/s: Server (S)
-
None
-
Environment:RHEL9, curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.76.1 OpenSSL/3.5.1
Steps to reproduce:
- Create Script Item that uses subsequent HttpRequest APIcalls (login, getinfo, logout, ...)
- Use one HttpRequest object and clearHeaders() fro the subsequent calls
- One of API calls returned HTTP400 error
- If the calls are done in CLI using curl command, everything works.
- This behaviour occured recently (do not know exact date) on scripts that works for years.
- If I create new HttpRequest for each subsequent call, everything works well.
My guess is that new HttpRequest creates new Curl handle initialized with defaults and this fix the problem.
Consider use curl_easy_reset() after each request call or add it to the clearHeaders() method.
https://curl.se/libcurl/c/curl_easy_reset.html
I have identified this problem in Nimble REST API https://support.hpe.com/docs/display/public/nmtp352en_us/jun1455055569904.html
Aftr login (POST request), the GET volumes must be done using new HttpRequest object, otherwise it fails returning HTTP 400.