Python脚本完成post接口测试的实例
一个post类型的接口怎么编写脚本实现
1、打开网页,在fiddler上获取到接口的URL
2、用Python的requests库实现
import requests new_url="http://10.31.143.2:8989/system/systemOrgan/list" params = {"access_token": "807ad226-cbcc-4620-9544-8f53e1d51405"} payload = { "organId":1, "pageNumber":1, "pageSize":10, "sortBy":"lastUpdateTime", "sort":"DESC"} results = requests.post(new_url, params=params, json=payload).status_code print(results)
输出接口
相关推荐
chichichi0 2020-06-16
Richardxx 2020-07-26
sunnyhappy0 2020-07-26
Guanjs0 2020-11-09
wmsjlihuan 2020-09-15
shishengsoft 2020-09-15
poplpsure 2020-08-17
CyborgLin 2020-08-15
knightwatch 2020-07-19
wcqwcq 2020-07-04
YAruli 2020-06-13
JF0 2020-06-13
84423067 2020-06-12
心丨悦 2020-06-11
zkwgpp 2020-06-04
stoneechogx 2020-06-04
litterfrog 2020-05-30