I have created a Jenkins job that can be triggered through a POST API call(i.e. buildWithParameters endpoint).
If I encode the parameters in URL, it works just fine. See an example below:
http://localhost:80/job/remote-job-2/buildWithParameters?token=password123&org=example.com
However, I would like to pass the parameters in the body of this POST request as shown below:
{
"token": "password123"
"org" : "example.com"
}
Note: The closest answer I could find is this What is the format of the JSON for a Jenkins REST buildWithParameters to override the default parameters values. Unfortunately, this does not work for me when I run this on postman. It fails with a +500 server error.