使用python-requests上传文件 - UnicodeDecodeError

时间:2013-10-30 20:14:42

标签: python python-requests

我试图用python-requests上传文件

with open('file.zip','rb') as fff:
    up = requests.post(url,files=[('file[]',fff)])

得到:

UnicodeDecodeError: 'ascii' codec can't decode byte ...

当试图使用unicode(fff)并上传文件但我下载了它只有70个字节

在记事本中打开的ZIP文件内容:

<open file 'file.zip', mode 'rb' at 0x0000000002F6E030>

0 个答案:

没有答案