I would like to process JSON in WepAPI 2.0 and in the JSON file must be = as a first char.
If I post normal JSON [{ ... }] visual studio return NULL exception and variable "value" is NULL
namespace MyProgram.Controllers
{
public class TestController : ApiController
{
// POST: api/test
public string Post([FromBody]string value)
{
value = value.Replace("\t", "");
List<Test> r;
r = JsonConvert.DeserializeObject<List<Test>>(value);
.....
}
}
}
If I post normal JSON [{ ... }] visual studio return NULL exception and variable "value" is NULL
namespace MyProgram.Controllers
{
public class TestController : ApiController
{
// POST: api/test
public string Post([FromBody]string value)
{
value = value.Replace("\t", "");
List<Test> r;
r = JsonConvert.DeserializeObject<List<Test>>(value);
.....
}
}
}