MVC Control 接收post请求的json数据

 [HttpPost]
        public string QueryInvoice()
        {
            string stream;
            using (var sr = new StreamReader(Request.InputStream))
            {
                stream = sr.ReadToEnd();
            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            QueryInfo info = js.Deserialize<QueryInfo>(stream);
            if (info == null)
            {
                return “请输入正确参数”;
            }
        }


 public class QueryInfo
    {
        public string caseNumber { get; set; }
        public string picture { get; set; }
    }
View Code
原文地址:https://www.cnblogs.com/ZJ199012/p/9922394.html