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

I had a bit of a more complex objects. A class emaillist

public class emailist
{
    public String id { get; set; }
    public String emailaddress { get; set; }
    public String name { get; set; }
}   

A class emailRecipientList

public class emailRecipientList
{
    public String procedure { get; set; }
    public String server { get; set; }
    public String filename { get; set; }
    public String fileid { get; set; }
    public List<emailist> emaillists { get; set; }

}

And a Task

public async Task<System.Xml.XmlElement> postUploadEmailRecipientList([FromBody] emailRecipientList recipientList)

Now to send the data as "application/x-www-form-urlencoded" enter image description here

If more elements need to get added just keep increasing the array index. I tested it on a asp.net WebAPI 2 project and worked fine.


If you want to pass 1,2,3 in array ads , try with below screenshot

enter image description here

Tags:

Arrays

Postman