Python
验证码123
这个作者很懒,什么都没留下…
展开
-
python脚本requets处理文件上传请求-multpart-formdata
method url header data= { 'dangerRegionBo': ('new_danger.json', open(r'D:\python\Lib\site-packages\Test1\new\new.json', 'rb'),'application/json'), 'file': ('abc.txt', open(r'D:\python\Lib\site-packages\Test1\abc.txt', 'rb'), 'text/pla原创 2021-07-20 14:16:04 · 194 阅读 · 0 评论 -
python 接口测试多文件上传
用requests 附件和数据都以文件形式上传, content-type不传 #coding:utf-8 import requests #content-type =multipart/form-data模式处理 def test(): data = { ‘file’: (‘abc.txt’, open(r’D:\python\Scripts\share\abc.txt’, ‘rb’), ‘text/plain’), ‘project’: (‘blob.json’, open(r’D:\python\S原创 2021-06-18 16:29:21 · 452 阅读 · 1 评论