#include
$home="C:\home.html"
$useragent = "Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"
$HttpOpen = _WinHttpOpen($useragent)
;_WinHttpSetOption($HttpOpen, $WINHTTP_OPTION_REDIRECT_POLICY, $WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS)
;$HttpConnect = _WinHttpConnect($HttpOpen, "ticketing.oebb.at")
$HttpConnect = _WinHttpConnect($HttpOpen, "ticketing.oebb.at", $INTERNET_DEFAULT_HTTPS_PORT)
;$HttpOpenRequest = _WinHttpOpenRequest($HttpConnect, "GET", "/inet/pub/ticket", Default, Default, Default)
$HttpOpenRequest = _WinHttpOpenRequest($HttpConnect, "GET", "/inet/pub/ticket", Default, Default , Default, $WINHTTP_FLAG_SECURE)
_WinHttpAddRequestHeaders($HttpOpenRequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($HttpOpenRequest, "Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3")
_WinHttpAddRequestHeaders($HttpOpenRequest, "Connection: keep-alive")
_WinHttpSendRequest($HttpOpenRequest)
_WinHttpReceiveResponse($HttpOpenRequest)
$sheader = _WinHttpQueryHeaders($HttpOpenRequest)
$sdata = _WinHttpReadData($HttpOpenRequest,0,500000)
MsgBox(0,"Header",$sheader)
$fh = FileOpen($home,2)
FileWrite($fh,$sdata)
FileClose($fh)
_WinHttpCloseHandle($HttpOpenRequest)
_WinHttpCloseHandle($HttpConnect)
_WinHttpCloseHandle($HttpOpen)