axios get request with header Authorization not working on Edge browser

这一生的挚爱 提交于 2019-12-24 14:22:34

问题


I am using axios get request with headers in vuejs application. Working fine and getting response in chrome and firefox. But in edge its not working, getting Network Error. I am sending the request with header Authorization.

 axios.get(url, {
    headers: {
    'Authorization': 'Basic bmlwerydmFdfgdfgdfllobjhJayw='
   }
  })
  .then(function(response) {
    console.log("Success");
   }
  }).catch(function(error) {
  console.log(error);
 });

showing following error in console.

 [object Error]: {config: Object, description: "Network Error", message: 
 "Network Error", request: Object, response: undefined...}

   config: Object
   description: "Network Error"
   message: "Network Error"

   request: Object
   response: undefined
   stack: "Error: Network Error at e.exports 
   (https://unpkg.com/axios@0.18.0/dist/axios.min.js:8:4473) at l.onerror 
   (https://unpkg.com/axios@0.18.0/dist/axios.min.js:8:3317)"

   __proto__: Object

if we send get request without any header it will work fine.How can i call axios with header Authorization.

Thank you

来源:https://stackoverflow.com/questions/55547550/axios-get-request-with-header-authorization-not-working-on-edge-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!