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

posted @ 2021-05-19 16:42  威威后花园  阅读(798)  评论(0编辑  收藏  举报