Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27353

Msxml2.XMLHTTP.6.0 Head problem

$
0
0
Good day, professionals.

I have a problem with Msxml2.XMLHTTP.6.0.

I have code:
Code:

Sub TestSend()

sURL = "http://ogame.ru/"
MethodSend = "GET"

 Set oXMLHTTP = CreateObject("Msxml2.XMLHTTP.6.0")
 With oXMLHTTP
        .Open MethodSend, sURL, False

.setRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
.setRequestHeader "Accept-Encoding", "gzip, deflate"
.setRequestHeader "Accept-Language", "ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"
'.setRequestHeader "Cache-Control", "max-age=0"
.setRequestHeader "Cache-Control", "no-cache"

.setRequestHeader "Connection", "keep-alive"
.setRequestHeader "Host", "ogame.ru"
.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"

.send

  headres = .getAllResponseHeaders()
  Debug.Print headres
     
       
End With

End Sub

I just repeat the first request of Mozilla.
And I would like to get cookies in head response
Code:

Connection        close
Content-Encoding        gzip
Content-Length        16051
Content-Type        text/html; charset=utf-8
Date        Sun, 14 Jul 2013 15:53:59 GMT
P3P        CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Server        Apache
Set-Cookie        SID=42k4mb4bra56l6eq6ucn7skg80; expires=Sun, 14-Jul-2013 16:53:59 GMT; path=/; domain=ogame.ru
Vary        Accept-Encoding

But I have only
Code:

P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Content-Type: text/html; charset=utf-8
X-Pad: avoid browser bug
Content-Length: 79007

What is interesting, for information, second response of Mozilla with saved cookies will be
Code:

Connection        close
Content-Encoding        gzip
Content-Length        15994
Content-Type        text/html; charset=utf-8
Date        Sun, 14 Jul 2013 16:15:18 GMT
P3P        CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Server        Apache
Vary        Accept-Encoding
X-Pad        avoid browser bug

This response is similar with truncated mine.

My goal is getting of SID in cookies.
You can test in VBA.

Please, help me, what is wrong???

I suppose, that may be problem in cookies, which saves in Msxml2.XMLHTTP.6.0 but
why response is truncated?

I am in complete disarray and despair, pls help.

Viewing all articles
Browse latest Browse all 27353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>