Jump to content

HTTP headers


ssamko
 Share

Recommended Posts

Hello !

I have a problem with getting whole header.

a part of my code:

#include <WinHttp.au3>
#include <Array.au3>
#include <String.au3>

Local $login_packet = "link"
$login.open("GET", $login_packet)
$login.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$login.send()
$login.WaitForResponse()
$headers= $login.GetAllResponseHeaders()
ConsoleWrite($headers)
Exit

this code can get info from header of logging to unnamed page like:

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Cache-Control: no-cache, must-revalidate
Connection: Keep-Alive
Date: Fri, 25 Dec 2015 21:56:29 GMT
Keep-Alive: timeout=30000, max=99999
Pragma: no-cache
Content-Length: 1410
Content-Type: text/html; charset=utf-8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
P3P: CP="CAO PSA OUR"
Server: Apache
Set-Cookie: dosid=8f6facdee90596745777dcdd1b1548a7; path=/
Set-Cookie: aid=deleted; expires=Thu, 25-Dec-2014 21:56:28 GMT; path=/
Set-Cookie: aip=deleted; expires=Thu, 25-Dec-2014 21:56:28 GMT; path=/
Set-Cookie: aig=deleted; expires=Thu, 25-Dec-2014 21:56:28 GMT; path=/
Set-Cookie: acr=deleted; expires=Thu, 25-Dec-2014 21:56:28 GMT; path=/
Set-Cookie: bptid=a11bc4807d8e485bf11ae2132f751f8a; path=/
Vary: Accept-Encoding,User-Agent
Content-Transfer-Encoding: 8bit
X-XTM-Node:

 

but when I sniffed headers there was 1 more item with name "location" and I dont know how to get that location.

I hope u understand(sorry for my english)

 

 

 

 

 

 

 

 

Edited by ssamko
Link to comment
Share on other sites

What you get is the header of the final response after all redirections have been followed. Location can't exist there.
If you want "Location" then disable redirects. Only then you wouldn't get the final page. Can't be both.

All in all, get familiar with HTTP protocol, at least on some basic level.

♡♡♡

.

eMyvnE

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