打开其它网站时,如何修改请求头?

2021-04-02 10:10:41 +08:00
 icemanpro
要跳转到其它网站上,但要将 token 加到请求头内,有没有什么办法?
2616 次点击
所在节点    Vue.js
12 条回复
no1xsyzy
2021-04-02 10:16:50 +08:00
跳转不能加任意头,只有 AJAX 请求可以加任意头。
killergun
2021-04-02 10:19:40 +08:00
跳转应该只能加在 url 上
wunonglin
2021-04-02 10:25:12 +08:00
啥意思?

请求第三方 API ?如果是这样的话直接带上就好了啊(要 CORS )。

url 跳转只能用 GET 请求参数带上
uselessVisitor
2021-04-02 10:25:43 +08:00
跳转不能
Balloonwj
2021-04-02 10:35:03 +08:00
下一个浏览器插件就可以了,例如 SmartHeader 。
leven87
2021-04-02 11:17:27 +08:00
For the description, I don't know. But request always could be based on http protocol, you could add token in the header part.
shellus
2021-04-02 11:18:46 +08:00
chrome 扩展:ModHeader
opengps
2021-04-02 11:20:21 +08:00
使用 js 函数控制跳转,避免 a 标签直接跳转
sxbxjhwm
2021-04-02 13:12:13 +08:00
自己搭一个反向代理
Alchemist13
2021-04-02 15:25:05 +08:00
@leven87 兄弟,为什么要在中文社区说英语,你会中文的吧 233
Te11UA
2021-04-02 15:48:39 +08:00
modheader 之类的 chrome 插件就能干
leven87
2021-04-02 22:16:44 +08:00
@Alchemist13 I just practice my English skill and don't want to forget. As well people here can understand.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/767447

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX