Gui Posted June 21, 2012 Share Posted June 21, 2012 So technically, to send a WinHTTP request, you have..: $h_openRequest = _WinHttpOpenRequest($hw_connect, "GET", "/" , "HTTP/1.1", "") _WinHttpSendRequest($h_openRequest) _WinHttpReceiveResponse($h_openRequest) $data = '' Do $data &= _WinHttpReadData($h_openRequest) Until @error Typically, some responses may take a few seconds to load, and thus slows your script. Is there a way to send the request but not wait for the load? In other words, instead leave it to load on its own and move on with the script? Thanks! GUI Link to comment Share on other sites More sharing options...
Gui Posted June 23, 2012 Author Share Posted June 23, 2012 Bump! Link to comment Share on other sites More sharing options...
Robjong Posted June 23, 2012 Share Posted June 23, 2012 (edited) This is one way to do it: ConsoleWrite("Script started" & @LF) AdlibRegister("foo") ; register the adlib function, this does not hold up the script ConsoleWrite("Script continues while the function is busy" & @LF) Sleep(4000) ; keep the script from terminating for a while ConsoleWrite("Script ended" & @LF) Func foo() AdlibUnRegister("foo") ; unregister the function to avoid it being called again ; winhttp etc. here... Sleep(1000) ; simulate waiting for a response ConsoleWrite("I did not hold up the script :)" & @LF) EndFunc Edited June 23, 2012 by Robjong Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now