What is wrong with the AJAX request? for some reason my browser picks it up as a GET request, when I specified it as a post???
var body = "<tsRequest><credentials name='username' password='password'><site contentUrl=''/></credentials></tsRequest>";
var url = "http://172.18.74.145/api/2.0/auth/signin";
$.ajax({
url: url,
crossDomain: true,
data: body,
type: 'POST',
contentType: "text/xml",
dataType: "jsonp",
success : console.log("too"),
error : function (xhr, ajaxOptions, thrownError){
console.log(xhr.status);
console.log(thrownError);
}
});
I get the error: GET http://172.18.74.145/api/2.0/auth/signin?callback=jQuery1720699254485778510…%20contentUrl=%27%27/%3E%3C/credentials%3E%3C/tsRequest%3E&_=1442263213074 405 (Method Not Allowed)
and if I change the "ajax" to "post" then the url is messed up.