$.ajax ({ type: "GET", url: "https://www.example.com", dataType: 'json', headers: { "Authorization", btoa(username + ":" + password) }, data: '{}', success: function (){ ... } });