Hi,
I have the below code, somehow I just cant seem to pass the parameters to
Jenkins:
var parameters = '{"parameter": [{"name":"id", "value": "2"}, {"name":"id2",
"value": "testing"}]}';
$.ajax({
url: "https://abc/job/test/buildWithParameters",
beforeSend: function(xhr) {
xhr.withCredentials = true;
xhr.setRequestHeader('cache-control', 'no-cache, must-revalidate,
post-check=0, pre-check=0');
xhr.setRequestHeader("Authorization", "Basic " +
btoa("abc:*******"));
},
type: "POST",
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
cache: false,
async: false,
processData: false,
data: 'json='+parameters,
success: function (data) {
alert(JSON.stringify(data));
},
error: function(){
alert("Cannot get data");
}});
Can someone please help me with what am I doing wrong? Also it always goes
in the error function and not in the success, why is that the case?
--Ishan
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/8d547989-5b1f-4815-ab1b-4500710ff791%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.