I have shell script to run from Jenkins. First step generates token. But when executed from Jenkins, it gives connection error
Jenkins here is Linux server
Command:
curl -w -X POST $URL -H Content-Type:application/x-www-form-urlencoded -H Content-Length:1045 -H Authorization:OAuth2 --data '{"grant_type":"password", "username":"User","password":"pwd"}' --write-out token
Error:
curl: (6) Could not resolve host: POST; Unknown error
100 88 0 0 0 88 0 0 --:--:-- 0:02:01 --:--:-- 0
100 88 0 0 0 88 0 0 --:--:-- 0:02:02 --:--:-- 0
100 88 0 0 0 88 0 0 --:--:-- 0:02:02 --:--:-- 0
curl: (56) Recv failure: Connection reset by peer
Build step 'Execute shell' marked build as failure