import requests
headers = {
"Content-Type": "application/json"
}
url = '' # url换成自己群机器人的webhookurl
data = {
'msgtype': 'text',
'text': {
'content': 'msg'
}
}
print(data)
res = requests.post(url, json=data,headers=headers) 里边不能是data=data,而是json=data
import cv2,requests
# from pyzbar import pyzbar
# cap = cv2.VideoCapture(0) # 打开摄像头
#
# while True:
# ret, frame = cap.read()
# Image = pyzbar.decode(frame)
# for data in Image:
# barcode_data = data.data.decode("utf-8")
# count+=1
# print(str(count)+barcode_data)
#
# cv2.imshow("Barcode Scanner", frame)
#
# if cv2.waitKey(5) == 27:
# break