用 mvc4中的WEBAPI, Post 到后台的参数如果为string,则直接接收不到,解决方案有两种
1、传递参数为自定义类
2、通过如下方式获取:
//获取传统context var context = (HttpContextBase)Request.Properties["MS_HttpContext"]; //定义传统request对象 var request = context.Request; string name = request["name"];
asp.net mvc4 webapi Post 参数 字符串
原文:http://www.cnblogs.com/lpe110/p/5085514.html