Python的requests软件包详解
来源:互联网 发布:云计算为什么这么火 编辑:程序博客网 时间:2024/05/22 15:04
requests是一款Python语言的HTTP类库,便于进行HTTP访问。
1. requests的特性
- 能够发送HTTP 1.1请求
- 无需手工为GET方法设置URL的请求参数,无需手工为POST方法设置参数编码
- 借助于urllib3实现HTTP请求的连接会话缓存
- 支持Python 2.6, 2.7, 3.3-3.7
pip install requests
3. requests的接口
1) Main interfaces
- requests.request()
- requests.head()
- requests.get()
- requests.post()
- requests.put()
- requests.patch()
- requests.delete()
import requestsrequests.Session()
3) requests.Request类
import requestsrequests.Request('GET', 'http://httpbin.org/get')
4) requests.PreparedRequest类
import requestsreq = requests.Request('GET', 'http://httpbin.org/get')preq = req.prepare()
5) requests.Response类
import requestsr = requests.get('https://api.github.com/events')r.text
6) requests.adapters.BaseAdapter类
7) requests.adapters.HTTPAdapter类
requests提供的使用urllib3的HTTP Adapter
参考链接:
文档,http://docs.python-requests.org/en/master/
代码,https://github.com/requests/requests/
Release notes,http://docs.python-requests.org/en/master/community/updates/
阅读全文
1 0
- Python的requests软件包详解
- python的requests库详解
- Python的urllib3软件包详解
- Python requests模块详解
- python Requests详解
- Python Requests库详解
- Python爬虫利器requests详解
- python爬虫requests库详解
- python的requests库
- python 的requests模块
- python requests的方法
- Python-requests的使用
- python软件包的卸载
- Python软件包的配置
- python的requests初步使用
- 【爬虫】Python的Requests模块
- Python之requests的安装
- python的requests初步使用
- Eclipse和Mysql之查询语句
- Java8之lambda表达式详解
- 安卓控件2
- 用malloc分配动态二维数组
- 网络监控利器-Zabbix的简介
- Python的requests软件包详解
- 美团 Robust热更新使用图解
- C6678多核DSP开发——vlib应用之连通域标记
- Hive on Tez部署及验证测试
- mac终端操作mysql
- xheditor struts2 上传文件
- 二叉查找树(通过外排思想处理大数据)
- (OK) Sample IPv6 Quagga config
- [command]脚本基本知识