문제

I have a following controller

public class MyController : ApiController
{
   [HttpPost]
   public string LoadData(string currentState)
   {

   }
}

I post some data from browser with jQuery.post. The length of the state should be 29915 characters, but currentState variable has only 21621 characters. The end of the string is lost. I checked if browser sends all data to the server and it does. So the problem somewhere on the server.

도움이 되었습니까?

해결책

Setting the ReadBufferSize helps:

protected void Application_Start(object sender, EventArgs e)
{
   GlobalConfiguration.Configuration.Formatters.FormUrlEncodedFormatter.ReadBufferSize = 256 * 1024; // 256 KB
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top