I've had problems trying to send JSON to ASP.NET MVC Controllers. I don't want to accept one string parameter on each controller method and deserialize manually. I have found that constructing a collection of post variables works reliably, but I don't have a generalized function to do so. I can write one myself if no one has done it already but I find it really hard to believe.
If no one answers this by tomorrow I guess I'll stop being lazy.
Edit: To be clear, I'm not asking how to serialize .NET objects to JSON. I'm asking if anyone has written a javascript function to do the following:
given javascript object:
{
name: { first: "first", last: "last" },
age: 35,
drinks: [
{ carbonated: false, name: "juice" },
{ carbonated: true, name: "soda" }
]
}
returns (POST request as object):
name.first : first
name.last : last
age : 35
drinks[0].carbonated : false
drinks[0].name : juice
drinks[1].carbonated : true
drinks[1].name : soda
Thanks.