使用 Postman 发送(嵌套)json 对象和文件

2022-01-22 00:00:00 json postman javascript httprequest

使用 Postman,我可以在请求中附加带有表单数据的文件,我还可以发送原始格式的嵌套 JSON 对象,但我怎样才能做到这两点:使用文件发送嵌套结构数据,例如:

With Postman, I can attach files in requests with form-data, I can also send nested JSON object in raw format, but how can I do both: sending nested-structure data with file, e.g:

"data": {
    "normal_fields": {
        "field1": "value1",
        "field2": "value2"
    },
    "image_file": <file>
}

推荐答案

尝试如下设置值并选择要上传的文件.

Try setting values like below and choose file to upload.

相关文章