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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM