[![enter image description here][1]][1]
[1]: https://i.sstatic.net/nvl1G.png
[Route("api/values")]
[ApiController]
public class ValuesController : ControllerBase
{
[Route("asd")]
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "value1", "value2" };
}
[Route("Test")]
[HttpPost]
public IActionResult Test([FromBody] Person p)
{
return Ok(p);
}
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
Im using asp.net core for web api. Currently doing testing on. Was using postman to post json object to web api. But i am not able to get the object. Below is the message return from web api
{
"errors": {
"": [
"A non-empty request body is required."
]
} ,
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "80000099-0007-fd00-b63f-84710c7967bb"
}