stormdead Posted April 15, 2015 Share Posted April 15, 2015 I can use this way to get headers: $xmlhttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $xmlhttp.open("GET", $CheckPage, False) $xmlhttp.send() $all = $xmlhttp.getAllResponseHeaders() $cookie = $xmlhttp.GetResponseHeader("Set-Cookie") How can i use this way to get header? url,cookie seem ok $oIE = _IECreate($CheckPage,1,1) $Obj = _IEDocGetObj($oIE) $head = $Obj.getResponseHeader $cookie = $Obj.cookie $url = $Obj.url I want to know more about _IEDocGetObj,is there any document? qqq~ Link to comment Share on other sites More sharing options...
JohnOne Posted April 15, 2015 Share Posted April 15, 2015 https://msdn.microsoft.com/en-us/library/ie/ms535862%28v=vs.85%29.aspx AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
stormdead Posted April 16, 2015 Author Share Posted April 16, 2015 https://msdn.microsoft.com/en-us/library/ie/ms535862%28v=vs.85%29.aspx 3Q But i find nothing about GetResponseHeader? It means I can't use $Obj.getResponseHeader to get ResponseHeader? Link to comment Share on other sites More sharing options...
JohnOne Posted April 16, 2015 Share Posted April 16, 2015 I'm almost afraid to confirm that, but I believe so, yes. IE object deals with all the http stuff internally and does not expose it to user. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Kyan Posted April 16, 2015 Share Posted April 16, 2015 WinHTTP FTW Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
stormdead Posted April 17, 2015 Author Share Posted April 17, 2015 3Q By the way , how can i get these header messages? Link to comment Share on other sites More sharing options...
JohnOne Posted April 17, 2015 Share Posted April 17, 2015 That question looks like an SQL query. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted April 17, 2015 Share Posted April 17, 2015 From the future. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Kyan Posted April 17, 2015 Share Posted April 17, 2015 (edited) stormdead, just use winHTTP UDF This should get you started #include <WinHttp.au3> #include <Array.au3> Global $sRetur[2] $gOpen = _WinHttpOpen('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0') ;_WinHttpSetTimeouts($gOpen, 1000, 4500, 4500, 4500) $gConnect = _WinHttpConnect($gOpen, "autoitscript.com") $gRequest = _WinHttpOpenRequest($gConnect, "GET","/forum/topic/169692-how-can-i-use-iedocgetobj-to-get-responseheader/", 'HTTP/1.1') ;_WinHttpSetOption($h_openRequest, $WINHTTP_OPTION_DISABLE_FEATURE, $WINHTTP_DISABLE_COOKIES) ;$rData Then _WinHttpSetOption($gRequest, $WINHTTP_OPTION_DISABLE_FEATURE, $WINHTTP_DISABLE_REDIRECTS) ;_WinHttpAddRequestHeaders($gRequest, "Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, */*") _WinHttpAddRequestHeaders($gRequest, "Accept: */*") _WinHttpAddRequestHeaders($gRequest, "Host: http://www.autoitscript.com") _WinHttpAddRequestHeaders($gRequest, "Connection: keep-alive") _WinHttpAddRequestHeaders($gRequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") ;_WinHttpAddRequestHeaders($gRequest, "Content-Type: application/x-www-form-urlencoded") ;_WinHttpAddRequestHeaders($gRequest, "Cache-Control: no-cache") _WinHttpAddRequestHeaders($gRequest, "Referer: http://www.autoitscript.com/forum/") _WinHttpAddRequestHeaders($gRequest, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3") _WinHttpAddRequestHeaders($gRequest, "Accept-Language: en-US,en;q=0.8,en-US;q=0.6,en;q=0.4") ;_WinHttpAddRequestHeaders($gRequest, "Accept-Encoding: */q=0") ;_WinHttpAddRequestHeaders($gRequest, "Cookie: Cookie=cookievalue") _WinHttpSendRequest($gRequest) _WinHttpReceiveResponse($gRequest) If _WinHttpQueryDataAvailable($gRequest) Then $sRetur[0] = _WinHttpQueryHeaders($gRequest) While 1 $chunk = _WinHttpReadData($gRequest) If @error Then ExitLoop $sRetur[1] &= $chunk Sleep(100) WEnd EndIf _ArrayDisplay($sRetur) Exit Edited April 17, 2015 by Kyan stormdead 1 Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
stormdead Posted April 20, 2015 Author Share Posted April 20, 2015 Get QQQ 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