Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery header basic auth

//Use jQuery's beforeSend callback to add an HTTP header with 
//the authentication information:

beforeSend: function (xhr) {
    xhr.setRequestHeader ("Authorization", "Basic " + btoa(username + ":" + password));
},
 
PREVIOUS NEXT
Tagged: #jquery #header #basic #auth
ADD COMMENT
Topic
Name
5+1 =