2011-04-01 33 views
1

我将Json数据发布到Restful Api。何处发布Data in HttpContext

服务器ASP.Net MVC应用程序中的数据自动绑定到使用JsonValueProviderFactory

[HttpPut] 
[ActionName("Student")] 
public ActionResult PutStudent(Student s) 
{ 
    return Content(""); 
} 

只有某些JSON数据被绑定到一个学生模型对象。其他人不是。在MVC应用程序中,我如何看到原始发布的数据?我无法在HttpContext中找到它。

请帮忙。

回答

3

尝试读取HttpContext.Request.InputStream对象中的流。

0

您可以使用Fiddler来检查原始HTTP流量。

+0

提琴手功能现在也基本内置到Chrome和Firebug中。 – 2011-04-01 12:16:02

+1

@NickLarsen,谁说客户端是浏览器?当然,如果是这样,FireBug就是要走的路。 – 2011-04-01 12:16:59