0
I am making a Web API in C# ASP.NET and in the POST method the value is returning me null
.
I’m using Postman to play a JSON within value but still returns me null
.
public string Post([FromBody]string value)
{
return value;
}
At the Postman I’m doing the following
{
"value" : "ana"
}
In the method signature is waiting to receive and return a string, and you are sending an object, this could be it. I played in . Net Core here and Kestrel doesn’t even accept the request. You can use
dynamic
to accept objects with indefinite structure, but recommend only for study purposes or very specific cases.– rogerdossantos