I got this simple request to an action in an asp.net core controller.
Controller:
[ApiController]
public class SystemAPIController : ControllerBase
{
[HttpPost("systemAPI/SetCulture")]
public async Task SetCulture([FromBody] string culture)
{
this.HttpContext.Session.SetString("Culture", culture);
}
}
The JSON in the body:
{
"culture": "nb-NO"
}
I get the following error when invoking the action using postman:
"The JSON value could not be converted to System.String. Path: $ | LineNumber: 0 | BytePositionInLine: 1."