python上传图片

作者:澎涛 | 分类:科技 | 发布时间:2021-09-29 16:48:39 | 阅读:1156 | 点赞:3 | 点踩:0
标签: python


import requests

print(‘start...’)

url = ‘http://xxxx:6881/addAlert.ashx?Alerttype=aaa&alerttime=2000-01-01 12:13:14&CameraCode=z01’

path = u’D:/ai1.jpg‘

print(path)

files = {’file‘: open(path, ’rb‘)}

r = requests.post(url, files=files)

print(r.url,r.text)


评论 (0)

登录 后发表评论

暂无评论