我正在尝试将数据集更新为webapi POST方法。如果data
是1K行,则调用正常,但如果发送~12K行,则webapi
为空。
public static string Update(string url, object data)
{
var client = GetClient();
//request
var request = new RestRequest(url, Method.POST);
var json = request.JsonSerializer.Serialize(data);
request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
request.RequestFormat = DataFormat.Json;
// execute the request
var response = client.Execute(request);
return response.Content; // raw content as string
}
有任何建议吗?
答案 0 :(得分:0)
将maxRequestLength
添加到web.config:
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime maxRequestLength="10000000" targetFramework="4.5.2" />
</system.web>