Sending (nested) json object with file using Postm

2019-05-06 21:10发布

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>
}

2条回答
放荡不羁爱自由
2楼-- · 2019-05-06 21:39

Try setting values like below and choose file to upload.

enter image description here

查看更多
可以哭但决不认输i
3楼-- · 2019-05-06 21:49

It didn't worked for me like that. For me only worked this way:

property[nested_field1]
property[nested_field2]

or arrays with objects:

array[0][nested_field1]
array[0][nested_field2]
array[1][nested_field1]
array[1][nested_field2]
查看更多
登录 后发表回答