📜  fetch 获取授权标头 - Javascript 代码示例

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

代码示例2
fetch('URL_GOES_HERE', { 
   method: 'post', 
   headers: new Headers({
     'Authorization': 'Basic '+btoa('username:password'), 
     'Content-Type': 'application/x-www-form-urlencoded'
   }), 
   body: 'A=1&B=2'
 });