-1

I have the following question, I want to make a request for a POST, I have 13 different Body's in environment variables, how can I put all 13 at the same time in Postman to execute? Is there any way?

This is my code: Some Bodies:

{ "et": "conta", "na": "List", "T": "list", "OPT": [ "TL-1", "TL-2" ], "DBY": "names user", "iM": false }

{ "et": "conta", "na": "Integer", "T": "integer", "DBY": "namesUser", "iM": false }

{ "et": "conta", "na": "MultiSelectList", "T": "multiSelect", "opt": [ "L1", "L2", "L3" ], "DBY": "names user", "iM": true }

What I am doing but I get error 400:

[
    {{List}},
    {{Integer}}
]

So I would like to know if there is any way to be able to execute the 13 Body's placing them all at the same time

Casper Dijkstra
  • 1,615
  • 10
  • 37
DastanAli
  • 15
  • 7

1 Answers1

1

Json arrays (https://restfulapi.net/json-array/) should be used for this

    [
        { 
             "et": "conta", 
             "na": "List", 
             "T": "list", 
             "OPT": [ 
                 "TL-1", 
                 "TL-2" 
             ], 
             "DBY": "names user", 
             "iM": false 
        },
        {
             (second array)
        },
        .
        .
        .
        {
             (thirteenth array)
        }
    ]

Good to know: you can use this tool to verify your json; https://jsonlint.com/

Whether or not this results in a status 400 error depends on the implementation of the web api's post method (and you mentioned this happens). In .NET, the received json should be converted to a List<T> instead of type T.

Casper Dijkstra
  • 1,615
  • 10
  • 37