Python -- post方式上传文件
来源:互联网 发布:json remove 编辑:程序博客网 时间:2024/05/16 01:31
说明
使用第三方库Request,安装方法为:
pip install requests具体安装方法参考http://docs.python-requests.org/en/master/user/install/。
代码
import requestsurl = 'http://127.0.0.1/upload'files = {'file': open('D:/test.apk', 'rb')} data = {'xxx':xxx,'xxx':xxx} response = requests.post(url, files=files, data=data)json = response.json()print(json)注:以上代码在Python 3.x版本测试通过。
0 0
- Python -- post方式上传文件
- Python中使用POST方式上传文件
- Python中使用POST方式上传文件
- Python中使用POST方式上传文件
- Python中使用POST方式上传文件
- POST方式上传文件
- python post上传文件
- python post方式 上传文件到php服务器
- python 通过post方式上传文件到php服务器
- jersey post方式上传文件
- IOS post方式上传文件
- http post方式上传文件
- android 使用post方式上传文件
- ASP.NET 利用post方式上传文件
- POST方式跨域上传文件
- (三)glassfish的post方式上传文件
- android 使用post方式上传文件
- POST方式跨域上传文件
- SQL里的EXISTS与in、not exists与not in(转载)
- Java学习(一)
- 蓝桥杯B六-----加变乘
- ftp目录赋予用户权限
- 批处理 - 精简
- Python -- post方式上传文件
- 欢迎使用CSDN-markdown编辑器
- Android 开发中使用 SQLite 数据库
- apache 启用 gzip压缩
- Meteor 组件 iron router 路由
- JavaScript进阶(九)JS实现本地文件上传至阿里云服务器
- Android文字长度未超过屏幕宽度也可以滚动的TextView
- [上下界费用流] BZOJ2055 80人环游世界
- JAVA数组