I'm making a POST request to API endpoint http://localhost:20779/api/Account and getting the following error.
The JSON value could not be converted to System.String. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
This is the JSON I'm using to make POST request.
{
"EmailAddress": "hello@example.com",
"Username": "example",
"Password": "mypassword",
"Status": "A",
"CreatedOn": "2021-08-10 08:00:00"
}
The request hits the POST method.
namespace HelpDesk.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class AccountController : ControllerBase
{
// POST api/<AccountController>
[HttpPost]
public void Post([FromBody] string value)
{
var x = string.Empty;
}
}
}