I have a script that delete and re-create jobs through curl HTTP-calls and I want to get rid of any hard-coded \"username:password\". E.g. curl -X POST $url --user use
curl -X POST $url --user use
This worked for me:
curl -u $username:$api_token -FSubmit=Build 'http:///job//buildWithParameters?environment='
API token can be obtained from Jenkins user configuration.