11

当我尝试通过 SSL 向 Asp.net Web API 发送一个非常大的 POST 调用时,我收到了这个错误。
我知道重新谈判的现象。
我的 uploadReadAheadSize 设置为最大值。(2147483647)

谁能告诉我一些我应该尝试的选择?

这是来自 Chrome 开发控制台的请求和响应:

在此处输入图像描述

我还尝试了以下命令但没有结果:

C:\Windows\System32\inetsrv\appcmd.exe 设置配置“Web API”-section:system.webServer/ServerRuntime /enabled:"1024000" /commit:apphost

C:\Windows\System32\inetsrv\appcmd.exe 设置配置“Web API”-section:system.webServer/ServerRuntime /uploadReadAheadSize:"1024000" /commit:apphost

4

2 回答 2

9

重要提示:此答案适用于HTTPS

  1. 转到配置目录

    C:/Windows/System32/inetsrv/config/

  2. 以编辑模式打开 applicationHost.config 文件。

  3. 为您的应用程序添加此配置

    示例:配置为 1 MB 上传

<location path="SiteName" overrideMode="Allow">
   <system.webServer>
     ......
      <serverRuntime enabled="true" uploadReadAheadSize="1024000" />     
     .....
   </system.webServer>
</location>
  1. 在 IIS 中重新启动您的站点
于 2015-10-07T07:43:27.340 回答
0

我在 Rest WCF Web API 中遇到了问题,并得到了如下所述的解决方案:

<webHttpBinding>
    <binding 
        maxBufferPoolSize="2147483647" 
        maxReceivedMessageSize="2147483647" 
        maxBufferSize="2147483647" 
        transferMode="Streamed">
    </binding>  
</webHttpBinding>
于 2016-12-02T11:52:43.607 回答