I can not send the correct request to the server to get an answer from it in the form of json string.
Code:
$.ajax({ type: "GET", url: url, dataType: 'json', crossDomain: true, username: 'username', password: 'password', headers: { 'Access-Control-Allow-Origin': '*' }, success: function(response) { console.log(response); } }) When you try to send a request, an error occurs:
XMLHttpRequest cannot load URL. It doesn’t give access to the requested resource. Origin 'null' is therefore not allowed access.
Access-Control-Allow-Originshould be given. Thus, the server says that remote requests can be made to it, they are disabled by default. - Vasily Barbashev