📌  相关文章
📜  jquery ajax headers: ('authorization': 'bearer) - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:33.550000             🧑  作者: Mango

代码示例2
$.ajax
({
  type: "GET",
  url: "index1.php",
  dataType: 'json',
  headers: {
    "Authorization": "Basic " + btoa(USERNAME + ":" + PASSWORD)
  },
  data: '{ "comment" }',
  success: function (){
    alert('Thanks for your comment!'); 
  }
});