Jump to content

how can i use _IEDocGetObj to get ResponseHeader


Recommended Posts

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

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 by Kyan

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
happy.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...