I have just started using Postman for testing my API. I am able to send list of request parameters, but could not figure out how will I send a parameter which is a dictionary,
say my request has two different parameters, first is property, and the structure of property is something like "ptype":"residential","mtype":"requirement","dtype":"sale","category":"multistoryapt","city":"Gurgaon,Mumbai"
How can I send these parameters together ? I have explored on internet and there are ways of sending an array but not a dictionary.
Am I missing something ?
You can do it with this:
POST Request in Postman:
Content-Type: Json/Application
{
"IsManual":true,
"platform":"IOS",
"barcodeList":{"1":"DSSDsdsdsas","2":"DSSDsdsdsas"},
"Client":"Cliente1",
"ScanDate":"2018-10-16T17:03:02.2347052-03:00"
}
You could send data as raw body with the Content-Type application/json, this way it's up to you how the data is structured.
If you want to send it in the application/json
format then the body should look like this:
{
"key1":"value1",
"key2":"value2"
}
For a comprehensive resource on how to serialise JSON go to http://www.newtonsoft.com/json/help/html/SerializingCollections.htm
If for some reason you cannot send it with json, here is how we send dictionaries in the form:
object[ptype], object[mtype], object[dtype], object[category], object[city]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With