标签:tran 进制 get ext content 图片 audio === pos
下载文件def down_kms(autho_details_id, headers): url = ‘?‘ res = s.get(headers=headers, url=url) with open(‘kms_mips.kms‘, ‘wb‘) as f: f.write(res.content) # 二进制
上传文件 def import_kmsdb(id, headers, kms_path): print(‘\n‘ * 3) print(‘===============开始上传==============‘) url = ‘?‘ files = {‘file‘: open(path, ‘rb‘)} data = {‘id‘:id} res = s.post(url=url, headers=headers, data=data, files=files)
Python中request使用post上传文件
原文地址:https://www.cnblogs.com/tarzen213/p/13356667.html