python接口自动化测试:传参数:data与json

# 传json参数
import requests
url = 'xxxxxxxx'
body = {
    'xxx': 'xxx',
    'xxx': 'xxx'
}
# body是json格式的
r = requests.post(url, json=body)
print(r.text)

 

 

 
posted @ 2019-11-07 15:02  weihanchen  阅读(329)  评论(0编辑  收藏  举报