7 November, 2014
0 Comments
1 category
If you want to sent arbitrary JSON data to a MVC controller action method, you can use the following code:
[HttpPost] public ActionResult HandleRequest() { // Read the RAW JSON from the request, // because MVC does not support a dynamic input parameter or an input parameter of type JObject. // ASP .NET Web API does support a dynamic input parameter or an input parameter of type JObject. string json = new StreamReader(this.Request.InputStream).ReadToEnd(); dynamic clientData = JObject.Parse(json);
Category: Uncategorized