📜  flask post - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:07.365000             🧑  作者: Mango

代码示例6
#make a POST request
import requests
dictToSend = {'question':'what is the answer?'}
res = requests.post('http://localhost:5000/tests/endpoint', json=dictToSend)
print 'response from server:',res.text
dictFromServer = res.json()