码迷,mamicode.com
首页 > 其他好文 > 详细

Working with Data Sources 2

时间:2016-11-15 10:35:32      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:bsp   headers   comm   from   apply   while   should   command   source   

1. While we would like to get some data from the server with authorization, we should apply token from the website frist. Then we pass token in the request command by using headers.

  headers = {"Authorization": "token 1f36137fbbe1602f779300dad26e4c1b7fbab631"}  

  response = requests.get("https://api.github.com/users/VikParuchuri", headers=headers)

2. 

Working with Data Sources 2

标签:bsp   headers   comm   from   apply   while   should   command   source   

原文地址:http://www.cnblogs.com/kingoscar/p/6064341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!