官网:http://docs.python-requests.org/en/master/

请求方式

requests.get()

requests.post()

requests.put()

requests.delete()

requests.head()

requests.options()

get请求:

requests.get(url, **kwargs)

参数:

method:

url:

params: 默认 None           Dictionary or bytes to be sent in the query string        get请求的url参数

data: 默认 None                Dictionary or bytes to send in the body                        post请求的请求体

headers: 默认 None          Dictionary of HTTP Headers to send                            请求头

cookies: 默认 None           Dict or CookieJar object to send                                   请求cookies

files: 默认 None                 Dictionary of ``'filename': file-like-objects`` for multipart encoding upload            put请求上传文件

auth: 默认 None                 Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth

timeout: 默认 None            How long to wait for the server to send data before giving up, as a float, or a (`connect timeout, read timeout <user/advanced.html#timeouts>`_) tuple.   请求超时时间

allow_redirects: 默认 True

proxies: 默认 None            Dictionary mapping protocol to the URL of the proxy.      代理

hooks: 默认 None

stream: 默认 None            Whether to immediately download the response content. Defaults to ``False``   是否立即下载响应内容

verify: 默认 None               if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.

cert: 默认 None                 if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.

json: 默认 None                json to send in the body                               put请求体

未完待续

使用 requests 模块的更多相关文章

  1. 爬虫requests模块 1

    让我们从一些简单的示例开始吧. 发送请求¶ 使用 Requests 发送网络请求非常简单. 一开始要导入 Requests 模块: >>> import requests 然后,尝试 ...

  2. requests 模块

    发送请求 使用Requests发送网络请求非常简单. 一开始要导入Requests模块: >>> import requests 然后,尝试获取某个网页.本例子中,我们来获取Gith ...

  3. requests模块--python发送http请求

    requests模块 在Python内置模块(urllib.urllib2.httplib)的基础上进行了高度的封装,从而使得Pythoner更好的进行http请求,使用Requests可以轻而易举的 ...

  4. Python requests模块学习笔记

    目录 Requests模块说明 Requests模块安装 Requests模块简单入门 Requests示例 参考文档   1.Requests模块说明 Requests 是使用 Apache2 Li ...

  5. Python高手之路【八】python基础之requests模块

    1.Requests模块说明 Requests 是使用 Apache2 Licensed 许可证的 HTTP 库.用 Python 编写,真正的为人类着想. Python 标准库中的 urllib2  ...

  6. Python requests模块

    import requests 下面就可以使用神奇的requests模块了! 1.向网页发送数据 >>> payload = {'key1': 'value1', 'key2': [ ...

  7. 基于python第三方requests 模块的HTTP请求类

    使用requests模块构造的下载器,首先安装第三方库requests pip install requests 1 class StrongDownload(object): def __init_ ...

  8. 使用requests模块爬虫

    虽然干技术多年了,但从没有写过博客,想来甚是惭愧,本篇作为我博客的第一篇,也是测试篇.不为写的好,只为博诸君一眸而已. 使用python爬虫,有几个比较常用的,获取html_content的模块url ...

  9. [实战演练]python3使用requests模块爬取页面内容

    本文摘要: 1.安装pip 2.安装requests模块 3.安装beautifulsoup4 4.requests模块浅析 + 发送请求 + 传递URL参数 + 响应内容 + 获取网页编码 + 获取 ...

  10. python爬虫之requests模块介绍

    介绍 #介绍:使用requests可以模拟浏览器的请求,比起之前用到的urllib,requests模块的api更加便捷(本质就是封装了urllib3) #注意:requests库发送请求将网页内容下 ...

随机推荐

  1. openGL实现图形学扫描线种子填充算法

    title: "openGL实现图形学扫描线种子填充算法" date: 2018-06-11T19:41:30+08:00 tags: ["图形学"] cate ...

  2. 福州大学软件工程1916 | W班 作业成绩排名汇总

    评分链接: 第一次作业-准备篇 https://www.cnblogs.com/deerCode/p/10527237.html 第二次作业-结对第一次-文献摘要热词统计原型设计 https://ww ...

  3. lotus domino 软件学习网站(自己收藏的)

    lotus domino 软件学习网站(自己收藏的) 我学习lotus domino时间也不是很长,相比较学习lotus,学习java的时间还是比较长的,刚开始看网上的说法都是不看好lotus的, 但 ...

  4. 【DOM练习】百度历史搜索栏

    HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <t ...

  5. 服务器被疑似挖矿程序植入,发现以及解决过程(建议所有使用sonatype/nexus3的用户清查一下)

    此次服务器被植入挖矿程序发现起来较为巧合,首先是上周三开始,我通过sonatype/nexus3搭建的仓库间歇性崩溃,但是每次重新start一下也能直接使用所以没有彻底清查,去docker logs里 ...

  6. hbase的一些要点

    hbase特点及简介: hbase源自于谷歌的三大论文之一 GFS -- hdfs MapReduce - MR BigTable - hbase hbase在以Hadoop为基础的生态圈中的地位 h ...

  7. java.sql.SQLException: ORA-28000: the account is locked

    解决方式:参考博客https://blog.csdn.net/java280580332/article/details/70756533

  8. Exp4 恶意代码分析 20164303 景圣

    Exp4 恶意代码分析 实验内容 实验点一:系统运行监控 (1)使用如计划任务,每隔一分钟记录自己的电脑有哪些程序在联网,连接的外部IP是哪里.运行一段时间并分析该文件,综述一下分析结果.目标就是找出 ...

  9. anaconda中安装mmdetection

    1.新建conda环境(有则跳过)     conda create -n py36 python=3.6 && source activate py36 2.安装pytorch    ...

  10. qt部件的可视性