Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use VBS to send HTTP request with Cookie

Shulou Source: shulou.com Published: 2022-06-03 08:36:13 10月04日 Update

This article mainly introduces how to use VBS to send HTTP requests with cookies. The article is very detailed and has certain reference value. Interested friends must read it!

To test this, write a simple PHP program that echoes cookies:

The code is as follows:

Then test with ServerXMLHTTP and XMLHTTP respectively:

The code is as follows:

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

Nothing is returned with Msxml2.XMLHTTP.

The code is as follows:

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

Return with Msxml2.ServerXMLHTTP

user => demon

passwd => 123456

The above is "How to use VBS to send HTTP requests with cookies" All the contents of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Code content articles tests values interests guys buddies more knowledge programs industry information information channels channels don't use reference help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn Linux Shulou Information macOS