Sending an array as form-data

You can send an array in form-data by using the same name for multiple keys, and putting values in each one. Please see the screenshots below for examples (substitute my_array ​ for any name you want):

In Bulk Edit mode:

In Key-Value Edit mode:

To test it out, you can try sending a POST request to https://postman-echo.com/post, and check the response:

2 Likes

This is not working for me.

I am only getting the last value in my_array.

Kindly assist.

I think it depends on how your own API what you receive. in my case I use .NET to receive an object DTO from the body which contains a property string[]

What language do you use to receive the POST?

Thanks for the reply.

I am using Laravel Lumen for the API.

I have found this post which said that this is a way to convert KeyValue pairs from JSON into an array. PHP is not my thing, maybe someone else can help you further.
see: https://stackoverflow.com/questions/7047870/issue-reading-http-request-body-from-a-json-post-in-php
Cheers

$input = json_decode($inputJSON, TRUE); //convert JSON into array

Thanks for the assist. Let me investigate.

Cheers!

make sure you put in your key ex. my_array

{
“Product_Reviews”:[
{“Customer_Name”:“Fakhar”,
“Customer_Description”:“Some Desciption”}
]

}

// Use this Format

use key[]: value