请教高手一个自定义HTTP头的问题,如何使得IE请求的数据包增加自定义内容;
比如,有test.asp和abc.zip,我点击一个超链接指向abc.zip,IE要向服务器发送HTTP头信息,通常如下:(我用WPE工具截获的)
GET /abc.zip 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, */*
Referer: http://localhost/test.asp
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate..User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; QQDownload 1.7; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Flag)
Host: localfost
Connection: Keep-Alive
现在我需要让IE向服务器发送的HTTP头信息增加自定义的COOKIE,用WPE获得请求如下:
GET /abc.zip 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, */*
Referer: http://localhost/test.asp
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate..User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; QQDownload 1.7; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Flag)
Host: localfost
Connection: Keep-Alive
Cookie:Flag=MyFlag
请问如何实现。我尝试在IIS中增加HTTP头也无用
------解决方案--------------------只要你在 test.asp 中 设置 Cookie ,并显示 <a href="abc.zip">下载</a> 即可。
从 test.asp 中,点击 下载,会自动加上 Cookie 信息的。
注意COOKIE期限及生命周期,作用域等的设置。
------解决方案--------------------dim cookie:cookie="Flag=MyFlag"
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", "/abc.zip", False
objXMLHTTP.setRequestHeader "Cookie",cookie
objXMLHTTP.Send
------解决方案--------------------顶了!
------解决方案--------------------
------解决方案--------------------