背景
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