Carlos Gil
Carlos Gil

Reputation: 605

Timeout for a HTTP Resquest

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_OnReadyStateChange
    ' do something
End sub

oHTTP.Send

Upvotes: 2

Views: 10114

Answers (1)

Samuel Zhang
Samuel Zhang

Reputation: 1280

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

Upvotes: 2

Related Questions