• 请不要在回答技术问题时复制粘贴 AI 生成的内容
firhome
V2EX  ›  程序员

添加自定义 header,请求变成 options 了。

  •  
  •   firhome · Mar 6, 2018 · 4325 views
    This topic created in 3177 days ago, the information mentioned may be changed or developed.
    通过 vue resouce 发起 get 请求。

    我在 get 请求 header 里加了个自定义 token,发现请求变成 options 了。 怎么破? 是不支持吗?
    3 replies  •  2018-03-07 13:25:50 +08:00
    bazingaterry
    bazingaterry
    Mar 6, 2018 via iPhone
    1
    cors
    shuizhengqi
    shuizhengqi
    Mar 7, 2018
    3
    option 是为了先请求服务器,获取到允许的请求方式,然后才会 get
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4149 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:23 · PVG 17:23 · LAX 01:23 · JFK 04:23
    ♥ Do have faith in what you're doing.