在測試客戶端通過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>