1

I'm not sure if anything has changed, but I'm sure, it was possible to pass an array like this:

enter image description here

This request would end up in array (php):

[
   'title' => 'Article',
   'author' => [
      'first_name' => 'John',
      'last_name' => 'Doe'
   ]
]

But if I try send this request now, it is no more possible and sends request like this:

[
   'title' => 'Article',
   'author[first_name]' => 'John',
   'author[last_name]' => 'Doe'
]

What am I doing wrong? How can I achieve sending nested array?

Thanks.

2
  • I don't think you can send a nested array here, because it contains key : value here Commented May 19, 2017 at 13:02
  • @MayankPandeyz as I said, it was working, but it doesn't anymore Commented May 19, 2017 at 15:05

1 Answer 1

3

If you pass things like that it will end up as strings on your server. If you are actually trying to pass nested/associative data you can change your body to raw and select JSON as the content-type.

{
    "title" : "Article",
    "author": {
        "first_name": "John",
        "last_name" : "Doe"
    }
}

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, I know that, thank you. But I'm 100% sure it was possible as I mentioned. This is a backup solution.
Are you sure your server side code was not parsing the string into an php array? If you think it is a bug in Postman you can discuss it in the Postman Community Slack channel - getpostman.com/slack-invite
I don't know, will try. Thank you for your help.
Also, for anybody coming across this answer years later like I did: Postman does not like single-quotes around JSON variable names, only double-quotes!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.