或将文件拖拽到这里(图片或zip包)
压缩包内的图片会被自动解压并上传
加载中...
import requests
url = 'https://photo-api.3412334014.workers.dev/upload'
file_path = '/path/to/your/photo.jpg'
with open(file_path, 'rb') as f:
files = {'file': (file_path.split('/')[-1], f, 'image/jpeg')}
response = requests.post(url, files=files)
print(response.json())
将上面的file_path替换为树莓派上的实际照片路径即可运行。