使用大数据(12K 个对象)调用 post 方法
calling post method with large data (12K objects)
我正在尝试将数据集更新为 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
}
有什么建议吗?
将maxRequestLength
添加到web.config:
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime maxRequestLength="10000000" targetFramework="4.5.2" />
</system.web>
我正在尝试将数据集更新为 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
}
有什么建议吗?
将maxRequestLength
添加到web.config:
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime maxRequestLength="10000000" targetFramework="4.5.2" />
</system.web>