I want to send array using postman.
the request looks like this:
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:
但它是错误的,因为价值广告是字符串而不是数组。
我有一些更复杂的物体。
班级电子邮件列表
public class emailist
{
public String id { get; set; }
public String emailaddress { get; set; }
public String name { get; set; }
}
A 类 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; }
}
还有一个任务
public async Task<System.Xml.XmlElement> postUploadEmailRecipientList([FromBody] emailRecipientList recipientList)
Now to send the data as "application/x-www-form-urlencoded"
如果需要添加更多元素,只需不断增加数组索引即可。
我在 ASP.NET WebAPI 2 项目上对其进行了测试,并且运行良好。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)