我知道如何提交带有文件的发布请求。
files = {'file': open('local.pdf', 'rb')} r = requests.post(url, files=files)
由于我是从响应中下载文件,因此我想避免response.contents在提交发布请求之前将其写入本地磁盘(“local.pdf”)。我可以将文件作为字节对象提交吗?
response.contents
python performance python-3.x python-requests
performance ×1
python ×1
python-3.x ×1
python-requests ×1