postman带文件的请求

背景

python代码中使用post方法请求接口,并传了二进制的文件,如何将其改造成postman请求

python的函数请求方法如下

url = http://10.10.121.12:8080/xxx
data_dict = {'data': '{"a": 1, "b": "[{\"key\":1}]"}'} # python的dict形式
uploadFile = {'uploadFile': open(upload_file_path, 'rb')}
response = request.post(url, data=data_dict, files=uploadFile)

postman填写

参考

1. https://www.cnpython.com/qa/348061

原文地址:https://www.cnblogs.com/syw-home/p/14785766.html