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