py request 基础
2019-11-19 本文已影响0人
子枫Eric
import requests
#常用的形式
# requests.get()
# requests.post()
# requests.put()
# requests.request('post')
# 参数
# url='xxx',
# params={'name':11,'pwd':1212},
# cookies = {},
# headers = {},
# data={},
# json={}
# get
# requests.get(
# url='xxx',
# params={'name':11,'pwd':1212},
# cookies = {},
# headers = {}
# )
#post
requests.post(
url='xxx',
params={'name':11,'pwd':1212},
cookies = {},
headers = {},
data={},
json={}
)
#session 容器 自动加入参数
session = requests.Session()
re = session.post(
url='aaa.php',
data = {}
)
更多精彩文章请关注 王明昌博客