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

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

  •  
  •   firhome · Mar 6, 2018 · 4237 views
    This topic created in 3075 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
        1
    bazingaterry  
       Mar 6, 2018 via iPhone
    cors
    shuizhengqi
        3
    shuizhengqi  
       Mar 7, 2018
    option 是为了先请求服务器,获取到允许的请求方式,然后才会 get
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3109 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:27 · PVG 08:27 · LAX 17:27 · JFK 20:27
    ♥ Do have faith in what you're doing.