先上代码:
object ohttp = CreateObject("winhttp.winhttprequest.5.1")
if IsComObject(oHttp) then
oHTTP.Open("GET", "https://www.baidu.com")
oHTTP.Send
oHttp = nothing
TracePrint oHTTP.Responsetext
Else
TracePrint "Error creating winhttprequest.5.1 COM Object"
end if和 VBS 是一样的,CreateObject 创建一个 winhttprequest 对象,然后直接发送请求就可以了。