Sending a (nested) json object with a file using Postman

With Postman, I can attach files in requests with form data, I can also send a nested JSON object in raw format, but how can I do this: send nested structure data with a file, for example:

"data": {
    "normal_fields": {
        "field1": "value1",
        "field2": "value2"
    },
    "image_file": <file>
}
+4
source share
2 answers

Try setting the values ​​below and select the file to upload.

enter image description here

+4
source

It did not work for me like that. For me, it only worked like this:

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]
0
source

Source: https://habr.com/ru/post/1589014/


All Articles