How to remove HTTP specific headers in Javascript

前端 未结 4 975
情歌与酒
情歌与酒 2020-12-31 04:41

Is it possible to, before sending a http message, remove some specific http headers using javascript / XmlHttpRequest ?

I\'m using a proprietary browser, so there\'s

4条回答
  •  無奈伤痛
    2020-12-31 05:08

    You could use the setRequestHeader method of the XmlHttpRequest object assuming your browser supports it, It is part of the W3C spec. It is also implemented by IE.

    var req = new XMLHttpRequest();
    req.setRequestHeader("Authorization", "");
    

提交回复
热议问题