I want to request a sharepoint server with ajax but I get an CORS error :
How can I solve this issue please
$.ajax({
url: "http://myserver.com" + "/_api/web/Lists/GetByTitle('Documents')/items?$select=ID,Title,FileRef",
async: false,
crossDomain: true,
headers: {
'accept': 'application/json;odata=nometadata'
},
complete: function(request) {
console.log("Request: " + JSON.stringify(request, null, 4));
},
error: function(request) {
console.log(JSON.stringify(request, null, 4));
}