Here's the basic setup, I have an asp.net core webapi controller (in c#) with a post function like so:
[HttpPost]
public ActionResult<string> Post([FromBody] string Name)
{
//Do some processing with the "Name" argument...
return Ok( "Success!" );
}
I'm trying to send the following raw JSON request body to this function:
{
"Name": "Foo"
}
But when send a post request to this function with the body above, I get back the following error in the server console:
"Executing ObjectResult, writing value of type 'Microsoft.AspNetCore.Mvc.SerializableError'"
And this error on the client side
{ "": [ "Unexpected character encountered while parsing value: {. Path '', line 1, position 1." ] }
I tried setting a break point at the beginning of the function but it doesn't even trigger! Why am I getting a serializable error?