Why should you base64 encode the Authorization header?

后端 未结 4 632
轻奢々
轻奢々 2021-02-08 13:56

Twitter\'s API requires sending an Authorization header that is a base64 encoding of an API key concatenated with an API secret key. In Node, I use:

var base64 =         


        
4条回答
  •  野的像风
    2021-02-08 14:40

    The string should be base64 encoded, not for security, but to encode non-HTTP-compatible characters into HTTP-compatible characters that may be in the username or password.

提交回复
热议问题