WebApi出现 HTTP Error 414. The request URL is too long问题解决

   在测试客户端通过WebApi上传Base64String图片字符串到接口的时候,出现HTTP Error 414. The request URL is too long的问题,百度的许久没合适了,google后才找到的方法。

   参考网址:http://blog.jonschneider.com/2016/01/configuring-aspnet-applications-in-iis.html

                     https://support.microsoft.com/en-us/help/820129/http-sys-registry-settings-for-windows

   解决方法:1.打开注册表【HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters】,创建MaxRequestBytes属性,类型为DWORD ,大小设置为16M内,我设置为:131070;

                     2.设置完后,又出现Response HTTP status code: HTTP 404问题,然后,在web.config中加入如下配置

<system.webserver>
  <security> 
    <requestFiltering> 
      <requestLimits maxQueryString="131070" /> 
    </requestFiltering> 
  </security> 
</system.webServer>

 

posted @ 2018-03-06 13:23  SnowSpace  阅读(7067)  评论(1编辑  收藏  举报