stx0821
V2EX  ›  问与答

为什么请求 Header 里加的 Token 要 Bearer 前缀呢。

  •  
  •   stx0821 · Oct 12, 2021 · 3043 views
    This topic created in 1849 days ago, the information mentioned may be changed or developed.

    例如请求 Header 为: Authorization: Bearer Token 这样多加一个 Bearer 有什么作用吗,仅仅只是约定俗成吗?

    4 replies  •  2021-10-12 17:20:59 +08:00
    love2020
    love2020
    Oct 12, 2021
    1
    可以不加。。看自己定义了 ,加 Token JWT 这种都有的
    aragakiyuii
    aragakiyuii
    Oct 12, 2021❤️1
    2
    为了区分类别
    还有 Digest 和 Basic
    Patrick95
    Patrick95
    Oct 12, 2021
    3
    Why is 'Bearer' required before the token in 'Authorization' header in a HTTP request?
    https://security.stackexchange.com/a/120244
    Xusually
    Xusually
    Oct 12, 2021
    4
    用的多的还有 Basic 等别的 credentials type
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2031 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:27 · PVG 00:27 · LAX 08:27 · JFK 11:27
    ♥ Do have faith in what you're doing.