- WinHttp.WaitForResponse(-1) ; Wait forever? No, 30 seconds max.
- WinHttp.WaitForResponse(60) ; Wait 60 seconds? No, 30 seconds max.
For example, modify ReceiveTimeout to 120 seconds:
WinHttp.SetTimeouts(0, 60000, 30000, 120000)
The first 3 values are the default values, see IWinHttpRequest::SetTimeouts method.
whr.Open("GET", URL, true)
whr.SetTimeouts(0, 60000, 30000, 120000)
whr.Send()
whr.WaitForResponse(90)[/code]
Edit: SetTimeouts should be set before open.
Code: Select all
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.SetTimeouts(0, 60000, 30000, 120000)
whr.Open("GET", URL, true)
whr.Send()
whr.WaitForResponse(90)