Posted in Python onSeptember 21, 2016
①GET
# -*- coding:utf-8 -*- import requests def get(url, datas=None): response = requests.get(url, params=datas) json = response.json() return json
注:参数datas为json格式
②POST
# -*- coding:utf-8 -*- import requests def post(url, datas=None): response = requests.post(url, data=datas) json = response.json() return json
注:参数datas为json格式
Python 使用requests模块发送GET和POST请求的实现代码
- Author -
mdxy-dxy声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@