preston.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Preston 作者: Celeo 项目源码 文件源码
def _build_auth_headers(self):
        """
        Build a dictionary of the authentication required for
        accessing OAuth endpoints.

        Args:
            None

        Returns:
            value (dict) with the 'Authorization' key and value
        """
        auth = base64.encodestring((self.client_id + ':' + self.client_secret).encode('latin-1')).decode('latin-1')
        auth = auth.replace('\n', '').replace(' ', '')
        auth = 'Basic {}'.format(auth)
        headers = {
            'Authorization': auth
        }
        return headers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号