【问题标题】:413 - Request Entity Too Large IIS and SSL413 - 请求实体太大 IIS 和 SSL
【发布时间】:2015-05-13 16:21:13
【问题描述】:

当我尝试通过 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

【问题讨论】:

标签: iis ssl http-status-code-413


【解决方案1】:

重要提示:此答案适用于 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 中重新启动您的站点

【讨论】:

    【解决方案2】:

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

    <webHttpBinding>
        <binding 
            maxBufferPoolSize="2147483647" 
            maxReceivedMessageSize="2147483647" 
            maxBufferSize="2147483647" 
            transferMode="Streamed">
        </binding>  
    </webHttpBinding>
    

    【讨论】:

      猜你喜欢
      • 2020-02-18
      • 1970-01-01
      • 2014-12-30
      • 2014-12-23
      • 2012-09-23
      • 2015-10-04
      • 2015-01-25
      • 2014-12-04
      相关资源
      最近更新 更多