Why do We use "AutoHotkey" as user agent?
Code: Select all
HINTERNET hInet = InternetOpen(_T("AutoHotkey"), INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY, NULL, NULL, 0);
With such user agent We cannot download some pages correctly.
Compare: this
Code: Select all
UrlDownloadToFile, https://www.google.com/search?q=banana&tbm=isch, test.txt
Code: Select all
HTTP := ComObjCreate("WinHTTP.WinHTTPRequest.5.1")
HTTP.Open("GET", "https://www.google.com/search?q=banana&tbm=isch", true)
HTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36 OPR/87.0.4390.45")
HTTP.Send()
HTTP.WaitForResponse()
msgbox % HTTP.ResponseText