Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send nested form-data using postman?

Tags:

django

postman

Assume I have some data as below,

{
    "name":"John",
    "age":30,
    "cars": 
    {
        "car_img_1":"car_img_file1",
        "car_img_2":"car_img_file2",
        "car_img_3":"car_img_file3"
    }
 }

How can I send it using POSTMAN with form-data?

NOTES
1. car_img_fileX will be the file(.jpg,.png etc types)
2. What I'd tried -->> POSTMAN Screenshot.
3. Local server builted with Django framework


Current Output
Receiving 5 different items/data instaed of Nested data--> see this Pycharm Debugger Output

like image 868
JPG Avatar asked Jun 06 '18 07:06

JPG


People also ask

How can I send form data in Postman?

As soon as you select the POST request type in Postman you will see that the option Body is enabled which has different options to send the data inside the body. These options are: Form-data. X-www-form-urlencoded.


1 Answers

Try this:

cars[0][car_img_1]:car_img_file1
cars[1][car_img_2]:car_img_file2

You can insert it in "bulk-edit" mode.

like image 180
Denis Koreyba Avatar answered Oct 21 '22 01:10

Denis Koreyba