0

I would like to send array of id's via postman

https://stackoverflow.com/questions/12756688/is-it-possible-to-send-an-array-with-the-postman-chrome-extension

I looked on to above thread, for me array[] /array[0] didn't work out, using same key with different value worked for me. Postman file

It gave enter image description here

But I am not able to send single element in array or an empty array.

I see it in req.body as a string of characters

So how should I send it?

Vivek
  • 61
  • 7
  • I also tried sending data as raw and also changed the content-type to application/json, I tried to console.log my req body but I got it empty {} – Vivek Feb 15 '23 at 13:58

1 Answers1

0

So I just needed to set extended option of urlencoded to true and use arr[0] in postman, and it worked for me.

just make express.urlencoded({extended : true}); it was set to false before and arr[] or arr[0] didnot worked.

Vivek
  • 61
  • 7