我正在向POST
asp.net mvc 项目中的 Home 控制器发送一个 ajax 请求。这是示例 javascript。( convertUtcToLocal 基本上是将时间返回到本地日期的函数)。
var data = [{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""},
{"Time":convertUtcToLocal(1377003600000),"OldValue":35.2,"NewValue":""}];
$.ajax({url : 'http://localhost:64387/Home/TableEdit',
type : 'POST',
contentType:'application/json',
dataType :'json',
data : JSON.stringify(data)});
在家庭控制器中,我得到,
[HttpPost]
public object TableEdit(object data)
{
// object is shown in the Watch as object
}
在 Google Chrome 中,我可以看到请求负载
如何访问 Home 控制器操作中的数据?