.NET如何为MVC增加允许的GET请求URL长度? [英] .NET How to increase allowed GET request URL length for MVC?

查看:281
本文介绍了.NET如何为MVC增加允许的GET请求URL长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在接收来自银行的回调,但它只适用于一个请求,该请求在获取请求中有1960个字符。

I am receiving callback from bank, but it only works with one request which has 1960 characters in get request.

另一个带有更多参数的更长请求是2236个字符很长,没有达到我们的MVC行动。

The other longer request with more parameters is 2236 characters long, which doesn't reach our MVC action.

我已经尝试在web.config中将maxUrlLength更改为4000(4000个字符?):

I already tried changing maxUrlLength to 4000(4000 characters?) in web.config:

<httpRuntime targetFramework="4.5" maxRequestLength="2097151" maxUrlLength="4000" />

但仍然是第一次回复未达到MVC行动。

But still first response doesn't reach MVC action.

他们从他们这边报告了更长的请求:

They reported from their side for longer request:


错误连接到以下URL的问题

ERROR Problem with connection to the following URL

这里似乎有什么问题?

推荐答案

如果您使用的是IIS 6及更高版本,请同时添加以下条目。如果您拥有托管应用程序池而非经典版本,则将使用此设置。

If you are using IIS 6 and above, also add following entry. This setting will be used if you have managed app pool rather than classic.

<system.web>
   <httpRuntime maxUrlLength="40960" maxQueryStringLength="2097151" />
</system.web>
<system.webServer>
<security>
   <requestFiltering>
      <requestLimits maxUrl="40960" maxQueryString="2097151" />
   </requestFiltering>
</security>
</system.webServer>

这篇关于.NET如何为MVC增加允许的GET请求URL长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆