lundi 16 mars 2015

SharePoint rest API HTTP401



I am trying to retrieve the lists of my web by REST API.

With this code I get HTTP 401. (the browser does not prompt for the credentials)



var requestUri = "http://sp13" + "/_api/web/lists";
var requestHeaders = { "accept": "application/json;odata=verbose" };
$.ajax({
url: requestUri,
async: true,
contentType: "application/json;odata=verbose",
headers: requestHeaders,
success: function (data) {
console.log("ok" + data);
},
error: function (msg) {
console.log("ko"+msg);
}
});


with id I add dataType :'jsonp' this code, the browser ask me for the credential, but I get this error:



because its MIME type ('application/atom+xml') is not executable, and strict MIME type checking is enabled.









0 commentaires:

Enregistrer un commentaire