(To clarify, I have read other questions and their answers and tried all solutions, but none of them solved the issue)
I\'m debugging locally a code that I\'ll deplo
For what it's worth, I got sick of trying to get it to serialize correctly and did it myself.
My data is a javascript array of strings which posts like "value=thing1,thing2,thing3" and I was able to serialize it using the following:
$('<form>', {
"id": "dynamicForm",
"html": '<input type="hidden" id="val" name="val" value="' + $scope.items + '" />',
"action": '/api/Example/',
"method": "post"
}).appendTo(document.body).submit();
Then on the server side:
[HttpPost]
[Route("")]
public HttpResponseMessage Post()
{
var values = HttpContext.Current.Server.UrlDecode(Request.Content.ReadAsStringAsync().Result).Replace("val=","").Split(',');
...
}
I believe the default model binder does not bind to fields, only properties with a public setter. Try changing your fields to properties:
public class PlayerEntry
{
public string userID { get; set; }
public string userName { get; set; }
public int userProgress { get; set; }
}