安装requests模块

pip install requests

request帮助文档查看

import requests

print(help(requests))
Help on package requests:

NAME
requests DESCRIPTION
Requests HTTP Library
~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET
usage: >>> import requests
>>> r = requests.get('https://www.python.org')
>>> r.status_code
200
>>> 'Python is a programming language' in r.content
True ... or POST: >>> payload = dict(key1='value1', key2='value2')
>>> r = requests.post('http://httpbin.org/post', data=payload)
>>> print(r.text)
{
...
"form": {
"key2": "value2",
"key1": "value1"
},
...
} The other HTTP methods are supported - see `requests.api`. Full documentation
is at <http://python-requests.org>. :copyright: (c) 2017 by Kenneth Reitz.
:license: Apache 2.0, see LICENSE for more details. PACKAGE CONTENTS
__version__
_internal_utils
adapters
api
auth
certs
compat
cookies
exceptions
help
hooks
models
packages
sessions
status_codes
structures
utils FUNCTIONS
check_compatibility(urllib3_version, chardet_version) DATA
__author_email__ = 'me@kennethreitz.org'
__build__ = 137220
__cake__ = '✨

Python接口自动化基础---环境准备的更多相关文章

  1. Python接口自动化基础---get请求

    1.没有参数的get请求 import requests r=requests.get('http://docs.python-requests.org/zh_CN/latest/user/quick ...

  2. Python接口自动化基础---cookie绕过登录

    使用fiddler获取登录cookie 对比登录前和登录后的cookis 登录前 登录后: 获得cookie之后,使用cookie访问,就可以获取登录态: import requests url='h ...

  3. Python接口自动化基础---token鉴权

    有些登录使用cookie,有些登录需要token验证,token传参一般有两种形式,一种是在请求头中,一种是使用URL传参 这里举例说明一下请求头中的token方式: #登录 param1={'use ...

  4. Python接口自动化基础---session关联接口

    登录一个系统之后,如果需要在登录状态下进行一些操作,那么需要怎样保持会话呢? 可以使用Session() 举例如下: import requests s=requests.Session() url1 ...

  5. Python接口自动化基础---post请求

    常见的post传递参数的类型有以下两种: 第一种:application/x-www-form-urlencoded,浏览器原生的form表单,格式如下:input1=xxx&input2=o ...

  6. 2020年第二期《python接口自动化+测试开发》课程,已开学!

    2020年第二期<python接口自动化+python测试开发>课程,12月15号开学! 主讲老师:上海-悠悠 上课方式:QQ群视频在线教学,方便交流 本期上课时间:12月15号-3月29 ...

  7. python接口自动化28-requests-html爬虫框架

    前言 requests库的好,只有用过的人才知道,最近这个库的作者又出了一个好用的爬虫框架requests-html.之前解析html页面用过了lxml和bs4, requests-html集成了一些 ...

  8. python接口自动化3-自动发帖(session)

    前言 上一篇模拟登录博客园,但这只是第一步,一般登录后,还会有其它的操作,如发帖,评论等,这时候如何保持会话呢? (敲黑板!!!由于博客园最近登录机制变了,登录全部走cookie登录) 一.sessi ...

  9. python接口自动化1-发送get请求

    前言 requests模块,也就是老污龟,为啥叫它老污龟呢,因为这个官网上的logo就是这只污龟,接下来就是学习它了. 一.环境安装 1.用pip安装requests模块 >>pip in ...

随机推荐

  1. [Beta]第四次 Scrum Meeting

    [Beta]第四次 Scrum Meeting 写在前面 会议时间 会议时长 会议地点 2019/5/12 22:00 30min 大运村公寓6F楼道 附Github仓库:WEDO 例会照片 工作情况 ...

  2. linux shell中如何批量添加一行内容到某些文件的末尾?

    答:先使用find找出要指定的某些文件,然后使用xargs和sed工具将内容插入到这些文件的末尾 find . -name 'filename*' | xargs sed -i '$a\added-c ...

  3. Python之schedule用法,类似linux下的crontab

    # -*- coding: utf-8 -*- # author:baoshan import schedule import time def job(): print("I'm work ...

  4. ISO/IEC 9899:2011 条款6.10.3——宏替换

    6.10.3 宏替换 约束 1.两个替换列表是相同的,当且仅当两个替换列表中的预处理符记都具有相同的数.次序.拼写,以及空白分隔符,这里所有的空白分隔符都认为是相同的. 2.当前被定义为一个类似对象的 ...

  5. echo * 和ls *之间的区别?

    背景描述: 今天 一同事做入职考试,涉及到1题目,echo * 和ls *之间的区别,没有用过这个用法,再次记录下. 操作过程: 1.执行echo * [root@localhost ~]# echo ...

  6. 不规则的Ifc构件顶点提取方法

    BIM模型中有很多不规则的构件,在IFC中这些不规则的构件一般用顶点的形式表示,顶点坐标提取路径:  IfcObject->IfcProductDefinitionShape->IfcSh ...

  7. Spring cloud微服务安全实战-7-5配置grafana图表及报警

    先过一下grafana的配置文件 grafana的配置文件. 右键服务的地址.发信人 账号 和面等 配置要连到prometheus上. 登陆的密码是多少,第二行是不允许用户注册. dashboard. ...

  8. CentOS离线状态下安装Python3.7.0

    1.下载python安装包以及依赖的包 python安装包:Python-3.7.0 下载地址:www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz ...

  9. 论文阅读:FaceBoxes: A CPU Real-time Face Detector with High Accuracy

    文章: <FaceBoxes: A CPU Real-time Face Detector with High Accuracy> Introduction 2个挑战: 1)在杂乱背景下人 ...

  10. [LeetCode] 270. Closest Binary Search Tree Value 最近的二叉搜索树的值

    Given a non-empty binary search tree and a target value, find the value in the BST that is closest t ...