swor
swor

Reputation: 901

How to send array via postman in POST request

I want to send array via postman in POST request. I want to send data like this

{
    "users": [1, 2]
}

I read this post Is it possible to send an array with the Postman Chrome extension?

and reproduced, but received an error (see image). How can i fix the error?

I am using django rest framework and server answered that

request["users"] is None

enter image description here

Upvotes: 1

Views: 638

Answers (1)

PDHide
PDHide

Reputation: 19929

you cannot send array through formdata , if your endpoint expects json then send it as body>raw>json:

enter image description here

Upvotes: 2

Related Questions