python上传图片

时间:2021/9/29 16:48:38 赞:2 踩:0 阅:188 标签: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)

评论一下

发表评论

注册用户登录后才能发表评论,请登录注册