stx0821
V2EX  ›  问与答

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

  •  
  •   stx0821 · Oct 12, 2021 · 2667 views
    This topic created in 1680 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
        1
    love2020  
       Oct 12, 2021
    可以不加。。看自己定义了 ,加 Token JWT 这种都有的
    aragakiyuii
        2
    aragakiyuii  
       Oct 12, 2021   ❤️ 1
    为了区分类别
    还有 Digest 和 Basic
    Patrick95
        3
    Patrick95  
       Oct 12, 2021
    Why is 'Bearer' required before the token in 'Authorization' header in a HTTP request?
    https://security.stackexchange.com/a/120244
    Xusually
        4
    Xusually  
       Oct 12, 2021
    用的多的还有 Basic 等别的 credentials type
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1047 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 19:12 · PVG 03:12 · LAX 12:12 · JFK 15:12
    ♥ Do have faith in what you're doing.