开发者

How to send binary file via REST in Python?

开发者 https://www.devze.com 2023-01-31 12:07 出处:网络
I\'m trying to upload a PDF file for docstoc but I haven\'t got any luck. I\'ve tried the restclient library开发者_运维知识库 for python but I have no idead how to upload/send a binary file lika a PDF

I'm trying to upload a PDF file for docstoc but I haven't got any luck. I've tried the restclient library开发者_运维知识库 for python but I have no idead how to upload/send a binary file lika a PDF. Could you guys provide examples on how to do this? I'd really appreciate it.


I see that is has been asked before. The idea is treat PDF as another file, but send the file as multipart/form-data. This answer here points you to two recipes which can be used to accomplish this.

0

精彩评论

暂无评论...
验证码 换一张
取 消