Curl cant properly execute in jenkins due to lower Curl version

Multi tool use
Curl cant properly execute in jenkins due to lower Curl version
this is my first time posting a question on stack overflow, please excuse me if I did anything wrong. Thank you.
So, I am trying to automate a database creation process with a version of Jenkins, however, I am stuck on the command:
curl -s -k -H "Content-Type: application/json" -H "Authroization: bearer ${TOKEN}:" -X POST -d @database.json https:/gaia……
The command works locally on git bash but when I ran it through the Jenkins Pipeline I get a 400 bad request error telling me that the required body is missing. It looks like the Jenkins is not finding the appointed JSON file.
After some digging, I saw that Jenkins has a lower version of Curl (7.29.0) and git bash has a higher version of Curl (7.56.1). When I read into the higher version Curl documentation it has the:
--data-raw HTTP POST data ‘@’ allowed
While the lower version of Curl does not.
I cannot update the current version of Jenkins that I am using. Is there a way to get around that command? Any help is appreciated. Thank you!
Hello, thank you so much for responding and pointing out my errors. I copied the command straight from the Jenkins file, this time it should work now. Do you think my problem is due to the curl version difference?
– Richy
12 hours ago
you dont need to update jenkins, Just update curl
– rohit thomas
6 hours ago
1 Answer
1
You need to update the version of CURL on the Jenkins agent that the job runs on.
If you are running the jobs on the Jenkins master (i.e. no external agents), then you should be able to SSH to the Jenkins master box and update curl (how to do this will depend on what OS you are running).
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Welcome to SO! The command you've posted appears to have been typed from memory rather than being copy-pasted, and as such has at least five blocking syntax errors. Can you please update it with the actual code to help eliminate syntax errors as the problem?
– that other guy
14 hours ago