接口自动化上传视频(python)

在做接口自动化中,很多都会涉及到上传图片或视频

需要注意头文件可变(Content-Type)去掉可变的

接口自动化上传视频(python)_第1张图片

 

需要加上file,我的如下: 

file = {"file": open(r'E:\test.mp4', 'rb'), "Content-Type": "application/octet-stream",
"Content-Disposition": "form-data", "filename": "test.mp4"}
response = requests.post(url, headers=headers, params=params, files=file, verify=False)

接口自动化上传视频(python)_第2张图片

 

你可能感兴趣的:(接口自动化上传视频(python))