HTTP响应因请求是本地还是远程而不同

时间:2013-03-19 14:15:14

标签: asp.net http iis

如果我在本地发出请求(POST [http:// localhost:8790 / blah /]),我会收到以下响应标题:

Cache-Control   private
Content-Length  32
Content-Type    application/json
Date    Tue, 19 Mar 2013 13:59:34 GMT
Server  Microsoft-IIS/7.5
X-AspNet-Version    4.0.30319
X-AspNetMvc-Version 4.0
X-Powered-By    ASP.NET

如果我远程发出请求(POST [http://123.456.1789:8790 / blah /]),我会收到以下响应标题:

Cache-Control   private
Content-Length  11
Content-Type    text/html
Date    Tue, 19 Mar 2013 14:08:40 GMT
Server  Microsoft-IIS/7.5
X-AspNet-Version    4.0.30319
X-AspNetMvc-Version 4.0
X-Powered-By    ASP.NET

POST参数非常肤浅:name = value1& name2 = value2

正如您所看到的,内容类型不同,因此返回的数据也不同。

有谁知道发生了什么事?

EDIT 本地请求

Accept  application/json
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cache-Control   no-cache
Connection  keep-alive
Content-Length  36
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Cookie  blah=blah;
Host    localhost:8790
Pragma  no-cache
Referer [http://localhost:8790/blah/]
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
X-Requested-With    XMLHttpRequest

远程请求

Accept  application/json
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cache-Control   no-cache
Connection  keep-alive
Content-Length  36
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Cookie  blah=blah;
Host    123.456.1789:8790
Pragma  no-cache
Referer [http://123.456.1789:8790/blah/]
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
X-Requested-With    XMLHttpRequest

0 个答案:

没有答案