ssamko

HTTP headers

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I know that I dont understand it well but I need it :) Thnx you for your help !

Share this post


Link to post
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