一个http协议和iis的疑问,跟微软中国站点有关
Laone 2004-05-01 10:38:19 用java写了一个socket小程序,就是用socket发送http请求,然后获取返回数据
在请求别的网站的时候,都可以返回正确的页面,可是我请求微软的主网站的地址的时候,返回给我的却是400错误,请看具体数据:
http请求http://www.microsoft.com/china/homepage/ms.htm发送的数据包:
GET /china/homepage/ms.htm HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, application/x-gsarcade-launch, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: www.microsoft.com:80
Connection: Keep-Alive
服务器返回给我的数据:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Sat, 01 May 2004 14:18:04 GMT
Connection: close
Content-Length: 20
<h1>Bad Request</h1>
这是怎么回事呢?它用了什么技术辨别是IE请求还是自己用socket请求?