python 模拟postman多次发送请求
#!/usr/bin/env python# -*- coding:utf-8 -*-# Author: supeihuang# Time: 2019/5/10 16:30#模拟postman进行测试import requestsimport jsonurl='http://127.0.0.1:6220/coldDataRecommend'headers = {'content-...
·
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: supeihuang
# Time: 2019/5/10 16:30
#模拟postman进行测试
import requests
import json
url='http://127.0.0.1:6220/coldDataRecommend'
headers = {'content-type': 'application/json'}
data_json= [ {"key1": "value1"},{"key2": "value2"}]
res =requests.post(url=url, data=json.dumps(data_json),headers = headers)
simWords = res.json()
print(simWords)更多推荐



所有评论(0)