【发布时间】:2015-04-13 08:38:03
【问题描述】:
我的 C# web api:
[HttpPost]
[Route("freeworks")]
public IHttpActionResult Post([FromBody]List<AgadoFreeWork> value)
{
我尝试将 POST 作为 XML 进行测试
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AgadoFreeWork>
<IsPublished>true</IsPublished>
....
但我要回来了
{
Message: "The request is invalid."
ModelState: {
value: [1]
0: "Error in line 1 position 23. Expecting element 'ArrayOfAgadoFreeWork' from namespace 'http://schemas.datacontract.org/2004/07/Agado.Restful.Classes'.. Encountered 'Element' with name 'ArrayOfAgadoFreeWork', namespace ''. "
-
}-
}
【问题讨论】:
-
问题是……?