用VBS实现的发送带Cookie的HTTP请求的代码
2018-10-12 14:10
465 查看
为了方便测试,先写一个回显Cookie的简单的PHP程序:
然后分别用ServerXMLHTTP和XMLHTTP测试:
用Msxml2.XMLHTTP什么都没有返回。
用Msxml2.ServerXMLHTTP返回
user => demon
passwd => 123456
以后碰到需要Cookie的网页就不用愁了。
原文: http://demon.tw/programming/vbs-http-cookie.html
<?php
foreach($_COOKIE as $key => $value)
echo "$key => $value\r\n";
?>
然后分别用ServerXMLHTTP和XMLHTTP测试:
Dim http
Set http = CreateObject("Msxml2.XMLHTTP")
http.open "GET", "http://demon.tw/test/cookie.php", False
http.SetRequestHeader "Cookie", "user=demon; passwd=123456"
http.send
WScript.Echo http.responseText
用Msxml2.XMLHTTP什么都没有返回。
Dim http
Set http = CreateObject("Msxml2.ServerXMLHTTP")
http.open "GET", "http://demon.tw/test/cookie.php", False
http.SetRequestHeader "Cookie", "user=demon; passwd=123456"
http.send
WScript.Echo http.responseText
用Msxml2.ServerXMLHTTP返回
user => demon
passwd => 123456
以后碰到需要Cookie的网页就不用愁了。
原文: http://demon.tw/programming/vbs-http-cookie.html
您可能感兴趣的文章:
相关文章推荐
- C++发送HTTP请求的实现代码
- 发送http请求的代码实现
- 发送http请求(多用途测试,这里用以测试cookie) ,java代码测试例子
- Postman发送带cookie的http请求
- 利用Java发送邮件的实现代码
- python cookielib 登录人人网的实现代码
- java代码实现发送邮件
- PHP邮件发送代码实现
- 网站cookie特效代码 在线给你的朋友发送推荐信
- JS使用cookie实现只出现一次的广告代码效果
- 获取外网IP并发送到指定邮箱的vbs代码[已测]
- PHP发送带附件邮件的实现代码
- [转]Remoting的一个代码示例(借助Remoting实现发送信息功能)
- VBS合并一个文件夹里的TXT的实现代码
- 用VBS实现监视进程创建与删除的代码
- 用vbs实现显示系统调色板的代码
- C#实现发送邮件——核心部分代码
- aiyao Linux下用c语言实现发送http请求 方式可以Get或者Post