how to send authorization in header of HTTP GET using ajax
var username="username_here";
var password="password_here";
$.ajax({
type: "GET",
url: "myapi.php",
dataType: 'json',
headers: {
"Authorization": "Basic " + btoa(username + ":" + password)
},
success: function (result){
console.log(result)
}
});AJAX Authorization
Also in JavaScript:
- jquery find by innertext
- Ocultar o mostrar elementos HTML con JQuery
- function in javascript
- how to create my own filter in js
- siblings jquery
- getting value from radio button javascript
- rest parameters
- restrict the user from going to signup or login page if the user is already logged in firebase auth
- javascript remove all spaces from string
- react dom
- .remove in jquery
- Please update your node with version 8.11.3 or greater (but not version 10)
- javascript array push method
- d-block d-none js
- js data object length
- js array delete last
- javascript dir
- remove element by class
- onPress image react native
- unpack list javascript
- toggle js
- how to get data send from a form express
- how to get the height of window in javascript
- javascript string first letter lowercase