简体   繁体   English

Windows Server 2008 R2 (VPS) 上的 IIS7.5 - POST 请求出现错误 400

[英]IIS7.5 on Windows Server 2008 R2 (VPS) - Error 400 on POST Request

I have a new VPS server running 2008 R2 and IIS 7.5.我有一个运行 2008 R2 和 IIS 7.5 的新 VPS 服务器。

Some client software (not browser) communicates with a server application (ASP.NET) via HTTP GET and POST requests.一些客户端软件(不是浏览器)通过 HTTP GET 和 POST 请求与服务器应用程序 (ASP.NET) 通信。

On IIS7.5 the HTTP POST requests are rejected with the error: "HTTP Error 400 - Request is badly formed"在 IIS7.5 上,HTTP POST 请求被拒绝并出现错误:“HTTP 错误 400 - 请求格式错误”

The same application works with no issues on IIS7 and has worked for years on IIS6.相同的应用程序在 IIS7 上运行没有问题,并且在 IIS6 上运行了多年。

I can only assume IIS7.5 does some additional validation checks?我只能假设 IIS7.5 做了一些额外的验证检查? Is there any way to turn them off?有什么办法可以关闭它们吗? I tried all the settings I found on MSDN but nothing seems to work so far and I cannot even get IIS to dump a log for the rejected requests!我尝试了在 MSDN 上找到的所有设置,但到目前为止似乎没有任何效果,我什至无法让 IIS 为被拒绝的请求转储日志!

Changing the client code is not an option.更改客户端代码不是一种选择。

Below is the POST Request that fails.下面是失败的 POST 请求。

Thank you, Nikos.谢谢你,尼科斯。

POST /NK002/Inbound.ashx?rid=0 HTTP/1.1
User-Agent: nkHTTP_1
Accept: */*
Accept-Encoding: identity; application/octet-stream; application/x-www-form-urlencoded
Host: www.nks001.com
Connection: keep-alive
Content-Length: 307

<nkXML>
  <header count="2">
    <service>Connection</service>
    <function>Initialize</function>
  </header>
  <body count="4">
    <platform>Windows</platform>
    <data>BbbFBwAAAABFPaRkAAAAAHN5aE8AAAAA</data>
    <attName_0>PoolRebel.Version</attName_0>
    <attValue_0>2</attValue_0>
  </body>
</nkXML>

The problem is your Accept-Encoding: header.问题是您的Accept-Encoding: header。 The last two Content-Codings are not valid:最后两个内容编码无效:

application/octet-stream
application/x-www-form-urlencoded

According to IANA's permissiable Content-Coding values you can only use:根据 IANA 允许的内容编码值,您只能使用:

compress
deflate
exi
gzip
indentity
pack200-gzip

Hypertext Transfer Protocol (HTTP) Parameters - IANA超文本传输协议 (HTTP) 参数 - IANA

IIS7.5 adhere's more rigorously to the standards than previous versions. IIS7.5 比以前的版本更严格地遵守标准。

Update:更新:

Further digging about produced this forum discussion:进一步挖掘产生了这个论坛讨论:

Thread: IIS 7.5 Accept-Encoding fails with multiple values线程:IIS 7.5 Accept-Encoding 失败并出现多个值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IIS7.5上的网站内部的Javascript无法运行-Windows Server 2008 R2 - Javascript not working inside a website on IIS7.5 - Windows Server 2008 R2 Windows Server 2008 R2 + IIS 7.5 + ASP.NET 4.0 = HTTP错误500.0 - Windows Server 2008 R2 + IIS 7.5 + ASP.NET 4.0 = HTTP Error 500.0 在IIS7.5上的Windows 2008R2上使用Telerik RadCaptcha出现404错误 - 404 error using telerik RadCaptcha on Windows 2008R2 on IIS7.5 2008 R2 IIS7.5上的ASP.NET MVC无法加载 - ASP.NET MVC on 2008 R2 IIS7.5 Not Loading 如何在IIS 7.5(Windows 2008 R2)中重定向绑定? - How to redirect a binding in IIS 7.5 (Windows 2008 R2)? 在Windows Server 2008 R2 SP1的IIS 7.5上注册.NET 4.5的安全方法 - Secure way for registering .NET 4.5 on IIS 7.5 on Windows Server 2008 R2 SP1 在IIS7.5中,哪个模块删除了400错误请求的主体 - In IIS7.5 what module removes the body of a 400 Bad Request 为什么cshtml文件无法呈现iis7.5 Windows Server 2008 - why aren't cshtml files rendering iis7.5 windows server 2008 主机切换到Windows 2008 IIS7.5和HttpHandlers不起作用 - Hosting Switched to Windows 2008 IIS7.5 and HttpHandlers Do Not Work 从Windows 2008 R2 / IIS 7.5移至Windows 2012 / IIS 8.0,网站无法正常运行 - Moved to Windows 2012/IIS 8.0 from Windows 2008 R2/IIS 7.5 and websites aren't working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM