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

2023-09-07 10:28:38 作者:爱丶不再眷顾

使用 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.