How to open a url using javascript and set custom HTTP headers to the request?

后端 未结 1 1380
死守一世寂寞
死守一世寂寞 2021-01-18 08:41

I want to redirect a user to a url through javascript after they click on a link. Now is there any way to send custom http headers along with this request. I want to send a

1条回答
  •  情歌与酒
    2021-01-18 09:19

    No.

    You can set custom headers if you are using XMLHttpRequest (although it might ban you from setting a Cookie header), but not otherwise (and a redirect is otherwise).

    0 讨论(0)
提交回复
热议问题