Objects can be nested inside other objects. Each nested object must have a unique access path. The same field name can occur in nested objects in the same document.
In Postman, change the method next to the URL to 'POST', and under the 'Body' tab choose the 'raw' radio button and then 'JSON (application/json)' from the drop down. You can now type in the JSON you want to send along with the POST request. If this is successful, you should see the new data in your 'db. json' file.
Send it as raw data and set the type to application/json
To post a nested object with the key-value interface you can use a similar method to sending arrays. Pass an object key in square brackets after the object index.
"Items": [
{
"sku": "9257",
"Price": "100"
}
]
I got it working using the Raw data option in postman, as you can see in the screen shot
This is a combination of the above, because I had to read several posts to understand.
Content-Type
to application/json
Accept
to application/json
{ "Obj1" : { "key1" : "val1" } }
Hope this helps!
The key-value pair can take advanced inputs.
Ex.
Simply add these parameters :
In the header option of the request, add Content-Type:application/json
and in the body, select Raw format and put your json params like {'guid':'61791957-81A3-4264-8F32-49BCFB4544D8'}
I've found the solution on http://www.iminfo.in/post/post-json-postman-rest-client-chrome
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