问题描述
- FTP模拟HTTP Basic Authorization
-
类似于HTTP协议
$.ajax
({
type: "GET",
url: "index1.php",
dataType: 'json',
async: false,
data: '{}',
beforeSend: function (xhr){
xhr.setRequestHeader('Authorization', "Basic " + btoa(username+":"+password));
},
success: function (){
alert('Thanks for your comment!');
}
});
时间: 2024-07-28 16:13:19