安装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. 14、Docker监控方案(Prometheus+cAdvisor+Grafana)

    上一篇文章我们已经学习了比较流行的cAdvisor+InfluxDB+Grafana组合进行Docker监控.这节课来学习Prometheus+cAdvisor+Grafana组合. cAdvisor ...

  2. 团队作业-Beta冲刺(4/4)

    队名:软工9组 组长博客:https://www.cnblogs.com/cmlei/ 作业博客:https://edu.cnblogs.com/campus/fzu/SoftwareEngineer ...

  3. 可伸缩性架构常用技术——之数据切分 Data Sharding/Partition

    1. 简介 本来想写一篇可伸缩性架构方面的文章,发现东西太多了,久久未能下笔,这里首先把大家最关注的数据切分(Partition/Sharding)方面的内容先写完,给大家参考. 我们知道,为了应对不 ...

  4. Tracking without bells and whistles

    Tracking without bells and whistles 2019-08-07 20:46:12 Paper: https://arxiv.org/pdf/1903.05625 Code ...

  5. mqtt 与 MQ 的区别

    mqtt 与 MQ 的区别: mqtt:一种通信协议,类似人类交谈中的汉语.英语.俄语中的一种语言规范MQ:一种通信通道,也叫消息队列,类似人类交谈中的用电话.email.微信的一种通信方式json: ...

  6. dubbo架构角色

    角色 Dubbo有5个参与者:其中Monitor.Registry不是必须的 Provider 暴露服务的服务提供方 Consumer 调用远程服务的服务消费方(负载均衡) Registry 服务注册 ...

  7. 什么是CN2线路

      CN2全称为中国电信下一代承载网,英文Chinatelecom Next Carrier Network,缩写为CNCN,进一步缩写为CN2. CN2线路的优势在哪里 CN2作为“精品网络项目”被 ...

  8. [转]白话HTTP短连接中的Session和Token

    我经常想象并怀念三十年前那原始而美好的互联网旧时光, 工作很轻松, 生活很悠闲. 上班的时候偶尔有些HTTP的请求发到我这里, 我简单的看一下, 取出相对应的html文档,图片,发回去就可以了, 然后 ...

  9. Python - Django - 序列化

    app01/__int__.py: import pymysql pymysql.install_as_MySQLdb() app01/models.py: from django.db import ...

  10. Swift编码总结5

    1.UIWindow属性: 1>.- (void)becomeKeyWindow;                               // override point for sub ...