Answers for "Base64 for the user name and password ajax"

2

jquery ajax basic authentication

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)
  }
});
Posted by: Guest on August-05-2019

Code answers related to "Base64 for the user name and password ajax"

Code answers related to "Javascript"

Browse Popular Code Answers by Language