Files
2020-08-10 11:44:02 +08:00

23 lines
648 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import requests
from websocket import create_connection
def sendEvent():
url = "http://192.144.229.49:8000/api/event/list"
imagePath = 'train.jpg'
data = {
"oldperson_id": 1,
"event_type": 0, # 0代表情感检测1代表义工交互检测2代表陌生人检测3代表摔倒检测4代表禁止区域入侵检测
"event_date": "2020-07-06", # 事件日期
"event_location": "", # 事件地点(选)
"event_desc": "老人笑了ba???" # 必填,事件描述
}
file = open(imagePath, 'rb')
imageFile = {'file': file}
requests.post(url, files=imageFile, data=data)