I am trying to create a HttpRequestMessage method in my ASP.NET MVC that takes a JSONElement. The problem is that whenever I try to make breakpoints in my code to check the JSONElement, it says that the parameter is of value kind= undefined:"".
The following is the JSON code that I am trying to pass:
{
"Username": "Username",
"Password": "Password"
}
And the following is the action method:
[HttpGet]
public HttpResponseMessage CheckingJson(JsonElement model)
{
try
{
return Request.CreateResponse(HttpStatusCode.OK,model.GetString());
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.NotFound, "NotFound");
}
}