I'm new here, hope I'm doing things the right way!
I want to dl this URL, I've done it before (with help) but now I accidentally deleted my source, and I can't remember where I got help or what the answer was, stupid me. As it is all I get is status 406 (unacceptable)
I used the example from AHK help, but with a little modification, added 2 lines, as far as I recall something about SetRequestHeader
This is the example from help, url is modified
req := ComObject("Msxml2.XMLHTTP")
; Open a request with async enabled.
req.open("GET", "https://xhamsterlive.com/Lily_Young/profile", true)
; Set our callback function.
req.onreadystatechange := Ready
; Send the request. Ready() will be called when it's complete.
req.send()
/*
; If you're going to wait, there's no need for onreadystatechange.
; Setting async=true and waiting like this allows the script to remain
; responsive while the download is taking place, whereas async=false
; will make the script unresponsive.
while req.readyState != 4
sleep 100
*/
Persistent
Ready() {
if (req.readyState != 4) ; Not done yet.
return
if (req.status == 200) ; OK.
MsgBox "Text: " req.responseText
else
MsgBox "Status " req.status,, 16
ExitApp
}
Bard knew the answer, just had to ask the right way.