我想在 Python 中通过 Post 请求发送多个图像。 为什么我的代码不起作用?
import io
import imageio
import requests
files = {}
with io.BytesIO() as memory_obj:
imageio.imwrite(memory_obj, image, format=".bmp")
memory_obj.seek(0)
files.update(image=memory_obj)
imageio.imwrite(memory_obj, image2, format=".bmp")
memory_obj.seek(0)
files.update(mask=memory_obj)
response = requests.post(url='http://127.0.0.1:9999/test',files=files )