If you want to post JSON like
{ "value" : {"firstName" : "Jane", "lastName" : "Doe" } }
to an ApiController method, you need to add an additional "model" server side
public class ValueModel
{
public Person value { get; set; }
}
public class Person
{
public string firstName { get; set; }
public string lastName { get; set; }
public List<string> activities { get; set; }
public string favoriteHobby { get; set; }
}
public HttpResponseMessage Post([FromBody]ValueModel model) { .. }
Alternatively, drop the {"value": ..}
in you JSON and just post var data_to_send = ko.toJSON(self)
This is because the model binder to bind the exact same "structure" of the JSON you post.