IWinHttpRequest::Open Method Successful?

Get help with using AutoHotkey and its commands and hotkeys
Wicked
Posts: 28
Joined: 05 Jun 2016, 20:34

IWinHttpRequest::Open Method Successful?

17 Nov 2017, 15:30

Hi everybody. Long time.

I'll keep it short:

Code: [Select all] [Download] GeSHi © Codebox Plus

_download_to_var(url){
req:=comobjcreate("WinHttp.WinHttpRequest.5.1")
;~ https://msdn.microsoft.com/en-us/library/windows/desktop/aa383989(v=vs.85).aspx
req.open("GET",url) ;~ <= Returns nothing, every time, regardless if url is resolved...
req.send() ;~ <= Error if "url" could not be resolved...
;~ ...




What's the best way to add a fail-safe so that if the URL doesn't exist it returns false or exits before send()? I could use comobjerror(), I suppose? I'm primarily looking for speed, as I'll be doing multiple back-to-back requests.

Thanks in advance.
A_AhkUser
Posts: 613
Joined: 06 Mar 2017, 16:18
Location: France

Re: IWinHttpRequest::Open Method Successful?

22 Nov 2017, 00:09

Hi Wicked,

For example:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Video Game Reader
Image
github
demo

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot] and 44 guests