【发布时间】:2017-05-16 08:13:11
【问题描述】:
我正在使用 Fiddler(或 post manager)来调用对我的 WebApi 的请求。 (它在 IIS 中作为 ASP.net 应用程序托管)
这是服务:
[HttpPost]
[ActionName("uploadRessources")]
[AllowAnonymous]
public HttpResponseMessage uploadRessources(ResourcesJson json)
{
...
return Request.CreateResponse(HttpStatusCode.OK, result);
}
对于短长度正文(3行数据)长度发布数据请求,如:
POST http://something.com/api/services/uploadRessources HTTP/1.1
Cache-Control: no-cache
Connection: keep-alive
Pragma: no-cache
Accept: application/json
Accept-Encoding: gzip
Accept-Language: he-IL
User-Agent: Mozilla/5.0
Content-Length: 451
Content-Type: application/json
Host: es.com
{ "l":
[{"MasterEntity":2,"screen":"ConfirmHealthDetailsPage","Lbl":"ApproveTheFollowingDetails","enus":"Approve the Following Details:","device":"mobile","description":"NULL"},
{"MasterEntity":2,"screen":"ConfirmHealthDetailsPage","Lbl":"PersonalDetails","enus":"Personal Details","device":"mobile","description":"NULL"},
{"MasterEntity":2,"screen":"FingerPrintResources","Lbl":"CANCEL","enus":"CANCEL","device":"mobile","description":"NULL"}]
}
我确实得到了成功的回应:
HTTP/1.1 200 OK
但是对于长体长度请求(101K)-
它被卡住了(它甚至没有在我的代码中达到断点,而在简短的请求中 - 它确实)并且我从未看到任何响应:
顺便说一句 - 如果稍后我再次运行短正文长度请求(同时仍在等待之前的大请求) - 我确实得到 200(对于短长度请求)。
在 web.config 中我确实设置了:
<httpRuntime enableVersionHeader="false" executionTimeout="100000000" maxRequestLength="999999999" />
在 IIS 中:没有请求过滤器
在事件查看器中 - 我没有看到任何异常或警告
IIS 版本:6.1 (windows 7) - 但它也发生在我们的服务器上。
问题
为什么我的 101k 长度请求无法访问我的 webapi?
编辑
我发现它发生在 >65k 的请求中。还是不知道是什么问题
【问题讨论】:
-
@user3060520 我发现它发生在 >65k 的请求中。还是不知道为什么
-
我找到了一些关于这个问题的资源:@987654324@
-
@user3060520 我使用 webapi 而不是 wcf
-
你试过“maxAllowedContentLength”Maximum request length exceeded
标签: c# asp.net iis asp.net-web-api iis-6