Search code examples
arrayspostman

Send array as part of x-www-form-urlencoded


I want to send array using postman. the request looks like this: enter image description here

Im using postman to execute requests. I found on the internet to send array via form-data or raw. But I need them to be send as x-www-form-urlencoded. I tried it this way: enter image description here

But its wrong because value ads is string not array.


Solution

  • I wasnt able to solve it via x-www-form-urlencoded even I found solutions like ads[].id, ads[0].id, ads.id,... It wasnt working. So I had to write it as raw. and in headers section change it this way. enter image description here

    And the body is:

    { "deleted": "false",
      "ads": 
      [
        {
          "id": 15
        },
        {
          "id": 20
        }
      ]
    }