My iphone client posts the following json to my mvc service. When posting data from html form it automatically converts form data to UserModel and passes the object to my Cr
Late but hope it helps someone.
What would be the cleanest solution to do the conversion from JSON to Object?
$.post("http://localhost:52161/Default/PostRawJson/", { json: {
"firstName" : "Some Name",
"lastName" : "Some Last Name",
"age" : "age"
}});
public void PostRawJson(string json)
{
var person = System.Web.Helpers.Json.Decode(json);
person.firstname...
}
This way you get a pure JSON object to work with in your controller as requested.