码迷,mamicode.com
首页 > 编程语言 > 详细

python request使用

时间:2016-08-18 19:35:55      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

 

相比httplib、urllib,request真是太美丽了,记录下

get请求:

    def get_res(url):
        res=requests.get(url)
        return res

  

返回值:

res.txt  字符格式
res.content  数组格式
res.json() 字典格式

  

python request使用

标签:

原文地址:http://www.cnblogs.com/muxinyue/p/5785004.html

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