日期:2014-05-19  浏览次数:21002 次

怎样提取HTTP头里面的信息
我自己做了个HTTP服务,下面代码是用IE登录时服务器收到的HTTP头信息,现在我想把里面的123456提取出来,就是GET   /123456   HTTP/1.1中间的那个,有没有相应的方法.(IE里的地址为http://127.0.0.1:8000/123456)
谢谢!
GET   /123456   HTTP/1.1
Accept:   image/gif,   image/x-xbitmap,   image/jpeg,   image/pjpeg,   application/x-shockwave-flash,   application/vnd.ms-excel,   application/vnd.ms-powerpoint,   application/msword,   */*
Accept-Language:   zh-cn
Accept-Encoding:   gzip,   deflate
User-Agent:   Mozilla/4.0   (compatible;   MSIE   6.0;   Windows   NT   5.1;   SV1;   Maxthon;   .NET   CLR   1.1.4322)
Host:   10.1.1.238:8000
Connection:   Keep-Alive

------解决方案--------------------
Request.Headers 属性
------解决方案--------------------
HTTP 头定义
GET <Path> HTTP/1.1
这个Path就是你请求的文件的路径.

举例来说:
你如果访问:
http://www.mySite.com/abc.html
那么在http头中就是
GET /abc.html HTTP/1.1

要得到这个path,在asp.net里面调用
Request.FilePath 就可以了
------解决方案--------------------
Request.Headers
------解决方案--------------------
Request.Headers