2017-03-02 5 views
1

webapi POSTメソッドにデータセットを更新しようとしています。 dataが1K行の場合はコールはOKですが、〜12K行を送信する場合はwebapiではnullです。大きなデータ(12K個のオブジェクト)を持つpostメソッドを呼び出す

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 
     } 

何か提案がありますか?

+1

ボディサイズは、あなたが – Coder

+0

感謝を使用しているWebサーバに依存します。それはうまくいった。 – beewest

+0

うれしい私は助けることができました! – Coder

答えて

0

web.configファイルにmaxRequestLengthを追加します。

<system.web> 
    <compilation debug="true" targetFramework="4.5.2" /> 
    <httpRuntime maxRequestLength="10000000" targetFramework="4.5.2" /> 
    </system.web>