I have an ASP.NET MVC 2 application (.NET 4) that takes an HTTP post with two parameters. The second parameter is a big chunk of html. The controller action is shown below.
[ValidateInput(false)]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult TriangleUpdate(string userId, string html)
{
var user = _udRep.GetUserInfoForUser(userId);
if (user == null)
{
return Json(new { Result = "INVALID_USER" });
}
System.Diagnostics.Debug.Write(html);
if (!EnsureValidTriangleHTML(html))
{
return Json(new { Result = "INVALID_HTML" });
}
//other code here
}
When the html that is posted to this method is fairly large, approx 300 KB, the content of the html parameter is truncated. The System.Diagnostics.Debug.Write(html) only outputs some of the content input that is passed in.
Fiddler shows full 'application/x-www-form-urlencoded' post going out with a "Content-Length: 366050" header. However on server side, only some of the content is available in the html parameter.
Is there some kind of buffer not being flushed or maximum content limit to HTTP posts?