开发者

Timeout for a HTTP Resquest

开发者 https://www.devze.com 2023-02-13 21:30 出处:网络
Is there another ProgID instead of \"MSXML2.XMLHTTP\" that lets you set a timeout in VBScript? OnReadyStateChange or similar must also work in VBScript.

Is there another ProgID instead of "MSXML2.XMLHTTP" that lets you set a timeout in VBScript? OnReadyStateChange or similar must also work in VBScript.

Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.timeout = 10000 'Throws an error
oHTTP.Open "GET", "http://www.google.com", True

oHTTP.OnReadyStateChange = GetRef("oHTTP_OnReadyStateChange")

Sub oHTTP_OnRea开发者_运维问答dyStateChange
    ' do something
End sub

oHTTP.Send


You can use either ServerXmlHttp with setTimeouts, or just use windows.XMLHttpRequest instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消