jenkinsci/jenkins — pull request #452 by rborer (2012-04-22 20:21:20+00:00)
Title: buildWithParameters: return a JSON string when client request it through content-type header

Hi,

I have made a small improvement around the buildWithParameters API. With this change, whenever a build is requested from an ajax client (like jQuery), the API will return a JSON string instead of doing a redirect on the job homepage. With this redirect, it's hard to know if the job was successfully scheduled or not as jQuery consider this as an error.

The JSON string returned is the job definition, I could not find something better to represent the newly scheduled job.

Could you consider merging this patch if you find it useful?

Best regards,
Reynald