官方版
Problem: Unexpected 400 Bad Request Error from IIS Express
When requesting http://ipv4.fiddler:2468 from an IIS Express instance, the server returns the following unexpected error message:
HTTP/1.1 400 Bad RequestContent-Type: text/html;charset=us-asciiServer: Microsoft-HTTPAPI/2.0Date: Wed, 22 Aug 2012 19:59:52 GMTConnection: closeContent-Length: 334<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""https://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE>Bad Request</TITLE><META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD><BODY><h2>Bad Request - Invalid Hostname</h2><hr><p>HTTP Error 400. The request hostname is invalid.</p></BODY></HTML>
Solution:
Replace http://ipv.fiddler:2468 with http://localhost.fiddler:2468.
谷歌翻译版
问题:IIS Expresss意外400请求错误
当从IIS Express实例请求http://ipv4.fiddler:2468时,服务器返回以下意外错误消息:
HTTP/1.1 400 Bad RequestContent-Type: text/html;charset=us-asciiServer: Microsoft-HTTPAPI/2.0Date: Wed, 22 Aug 2012 19:59:52 GMTConnection: closeContent-Length: 334<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""https://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE>Bad Request</TITLE><META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD><BODY><h2>Bad Request - Invalid Hostname</h2><hr><p>HTTP Error 400. The request hostname is invalid.</p></BODY></HTML>
解决方案:
将 http://ipv.fiddler:2468 替换为 http://localhost.fiddler:2468.
