一、requests安装
前提:已经安装python运行环境,且配置好环境变量
1、安装requests模块
cmd进入dos窗口:pip install requests
pip install requests
2、查看requests
pip show requests
二、使用requests发送请求
1.get请求
需要请求接口文档如下:
思路:
1、清楚接口url
2、需要传入的参数,类型,是否必填
3、接口请求方式,post还是get
4、调用requests,发送请求,需要把请求url、请求方法、请求参数统一发送
5、查看接口的返回结果
代码如下(示例):
import requests
url = "http://v.juhe.cn/exp/index"
param =