import requests
import json
url = 'http://192.168.122.45:5001/analyze'
data = {
'key': 'emotion',
'data': 'img'
}
## headers中添加content-type参数,指定为json格式
headers = {'Content-Type': 'application/json'}
## post时,用json包将data字典形式的参数转换成json格式。
response = requests.post(url='url', headers=headers, data=json.dumps(data))
03-23
2186
05-25
7416
03-15
879
10-19
3024