【问题标题】:Issue with Query String Parameter Length. Http Error 400查询字符串参数长度问题。 Http 错误 400
【发布时间】:2015-10-15 23:07:09
【问题描述】:

谁能告诉我我的网址有问题:- http://www.advantarealty.net/Search//Condo,Single-Family-Home,Townhome_PropertyType/True_ForMap/8_Zoom/-81.3043212890625T29.099376992628493,-80.88134765625T28.9120147012556,-80.826416015625T28.41555985166584,-81.1669921875T28.033197847676377,-81.6888427734375T28.033197847676377,-82.1392822265625T28.222130007158537,-82.2601318359375T28.584521719370418,-82.1612548828125T28.92163128242129,-81.9305419921875T29.257648503615542,-81.6339111328125T29.248063243796576,-81.6064453125T28.849485201023,-81.3043212890625T29.099376992628493_Polygon/

我总是遇到错误。

错误请求 - 无效的 URL。 HTTP 错误 400。请求 URL 无效。

在上面的 URL 中,我猜它超过了最大查询字符串参数长度,所以我尝试像下面这样增加它。

<system.web>
    <!--<httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>-->
    <httpRuntime targetFramework="4.5" maxUrlLength="2097151" relaxedUrlToFileSystemMapping="true" maxQueryStringLength="2097151" />
</system.web>
<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxUrl="40960" maxQueryString="2097151" />
      </requestFiltering>
    </security>
  </system.webServer>

我试过了 request exceeds the configured maxQueryStringLength when using [Authorize]

How to configure the web.config to allow requests of any length

【问题讨论】:

  • 你试过非 ie 浏览器,它们提供高达 5 mb 的数据
  • 我正在检查 Chrome 43,FF 39
  • @JitendraPancholi 你好先生,你有解决办法吗,那么请帮助我。
  • @Abhishek:是的,我会尽快添加解决方案。
  • @JitendraPancholi 你是怎么解决这个问题的?

标签: .net asp.net-mvc iis webserver windows-server-2008


【解决方案1】:

您的网址中有似乎不属于您的正斜杠。如果你替换

http://www.advantarealty.net/Search//Condo,Single-Family-Home,Townhome_PropertyType/True_ForMap/8_Zoom/...”

"http://www.advantarealty.net/Search/Condo,Single-Family-Home,Townhome_PropertyType,True_ForMap,8_Zoom,"

您将获得一个有效的 URL。我通过复制您问题中的 URL 并替换那些无关的“/”来证明这一点。

【讨论】:

  • 这不是问题,我添加了适当的路由来接受查询字符串中的任何数据。我的问题现在已经解决了。不过谢谢你的回复。
  • 有趣...您原始问题中的链接在 Firefox (38) 上没有呈现任何内容,除非我用逗号替换了斜杠。无论如何,很高兴你能成功。
猜你喜欢
  • 1970-01-01
  • 2014-08-18
  • 2014-01-14
  • 1970-01-01
  • 2018-09-15
  • 1970-01-01
  • 2015-10-16
  • 1970-01-01
相关资源
最近更新 更多