import requests
def create_users():
data = {
"userlist": [
{
"username": "zhangsan",
"age": 18,
},
{
"username": "zhangsan",
"age": 18,
}
]
}
headers = {"contentType": 'application/json'}
url = 'http://127.0.0.1:5001/create/users'
res = requests.post(url, json=data, headers=headers)
print(res.text)
if __name__ == '__main__':
send_sys_msg()
contentType: 'application/json',接收参数 用下面那两种
print(request.json) print(request.get_data())


![flask post 请求 ImmutableMultiDict([]) flask post 请求 ImmutableMultiDict([])](http://www.mshxw.com/aiimages/31/844279.png)
