Why should you base64 encode the Authorization header?

后端 未结 4 628
轻奢々
轻奢々 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 15:00

    The Basic Authentication Scheme is described in the RFC7617 (and the old RFC2617).

    This is a standard way to send password credentials to the server. The base64 encoding is used to encode credentials to allow non HTTP characters and multibytes strings to be sent.

提交回复
热议问题