Cursus ASP : HTTP-headers lezen
ALL_RAW :
Cache-Control: no-cache
Connection: close
Pragma: no-cache
Accept: text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding: gzip
Accept-Language: en-us,en;q=0.5
Cookie: ASPSESSIONIDQSDDSTRR=JJAPHCLCHGGHGCMEIJEEPCCB
Host: www.ivobrugge.be
User-Agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
x-cc-id: ccc02-02
ALL_HTTP :
HTTP_CACHE_CONTROL:no-cache
HTTP_CONNECTION:close
HTTP_PRAGMA:no-cache
HTTP_ACCEPT:text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING:gzip
HTTP_ACCEPT_LANGUAGE:en-us,en;q=0.5
HTTP_COOKIE:ASPSESSIONIDQSDDSTRR=JJAPHCLCHGGHGCMEIJEEPCCB
HTTP_HOST:www.ivobrugge.be
HTTP_USER_AGENT:CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
HTTP_X_CC_ID:ccc02-02
HTTP_REFERER :
Alle severvariabelen
ALL_HTTP : HTTP_CACHE_CONTROL:no-cache HTTP_CONNECTION:close HTTP_PRAGMA:no-cache HTTP_ACCEPT:text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip HTTP_ACCEPT_LANGUAGE:en-us,en;q=0.5 HTTP_COOKIE:ASPSESSIONIDQSDDSTRR=JJAPHCLCHGGHGCMEIJEEPCCB HTTP_HOST:www.ivobrugge.be HTTP_USER_AGENT:CCBot/1.0 (+http://www.commoncrawl.org/bot.html) HTTP_X_CC_ID:ccc02-02
ALL_RAW : Cache-Control: no-cache Connection: close Pragma: no-cache Accept: text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding: gzip Accept-Language: en-us,en;q=0.5 Cookie: ASPSESSIONIDQSDDSTRR=JJAPHCLCHGGHGCMEIJEEPCCB Host: www.ivobrugge.be User-Agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html) x-cc-id: ccc02-02
APPL_MD_PATH : /LM/W3SVC/2043898605/ROOT
APPL_PHYSICAL_PATH : d:\accounts\ivobrugge.be\WWW\
AUTH_PASSWORD :
AUTH_TYPE :
AUTH_USER :
CERT_COOKIE :
CERT_FLAGS :
CERT_ISSUER :
CERT_KEYSIZE :
CERT_SECRETKEYSIZE :
CERT_SERIALNUMBER :
CERT_SERVER_ISSUER :
CERT_SERVER_SUBJECT :
CERT_SUBJECT :
CONTENT_LENGTH : 0
CONTENT_TYPE :
GATEWAY_INTERFACE : CGI/1.1
HTTPS : off
HTTPS_KEYSIZE :
HTTPS_SECRETKEYSIZE :
HTTPS_SERVER_ISSUER :
HTTPS_SERVER_SUBJECT :
INSTANCE_ID : 2043898605
INSTANCE_META_PATH : /LM/W3SVC/2043898605
LOCAL_ADDR : 217.19.238.112
LOGON_USER :
PATH_INFO : /cursusweb/asp/request/http.asp
PATH_TRANSLATED : d:\accounts\ivobrugge.be\WWW\cursusweb\asp\request\http.asp
QUERY_STRING :
REMOTE_ADDR : 38.107.179.222
REMOTE_HOST : 38.107.179.222
REMOTE_USER :
REQUEST_METHOD : GET
SCRIPT_NAME : /cursusweb/asp/request/http.asp
SERVER_NAME : www.ivobrugge.be
SERVER_PORT : 80
SERVER_PORT_SECURE : 0
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Microsoft-IIS/6.0
URL : /cursusweb/asp/request/http.asp
HTTP_CACHE_CONTROL : no-cache
HTTP_CONNECTION : close
HTTP_PRAGMA : no-cache
HTTP_ACCEPT : text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET : ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING : gzip
HTTP_ACCEPT_LANGUAGE : en-us,en;q=0.5
HTTP_COOKIE : ASPSESSIONIDQSDDSTRR=JJAPHCLCHGGHGCMEIJEEPCCB
HTTP_HOST : www.ivobrugge.be
HTTP_USER_AGENT : CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
HTTP_X_CC_ID : ccc02-02
REMOTE_HOST
38.107.179.222
Code :

<% response.write "<div style=""margin:20;padding:10;border:solid;border-width:1;background:#99FF99;width:200"">ALL_RAW :</DIV>" response.write "<pre>" &request.servervariables("All_RAW") &"</pre>" response.write "<div style=""margin:20;padding:10;border:solid;border-width:1;background:#99FF99;width:200"">ALL_HTTP :</DIV>" response.write "<pre>" &request.servervariables("All_HTTP") &"</pre>" response.write "<div style=""margin:20;padding:10;border:solid;border-width:1;background:#99FF99;width:200"">HTTP_REFERER :</DIV>" response.write "<pre>" &request.servervariables("HTTP_REFERER") &"</pre>" response.write "<div style=""margin:20;padding:10;border:solid;border-width:1;background:#99FF99;width:200"">Alle severvariabelen</DIV>" for each svar in request.servervariables response.write svar &" : " &request.servervariables(svar) &"<BR>" next response.write "<div style=""margin:20;padding:10;border:solid;border-width:1;background:#99FF99;width:200"">REMOTE_HOST</DIV>" response.write "<pre>" &request.servervariables("REMOTE_HOST") &"</pre>" %>
Uitleg :

Wanneer een client een webpagina opvraagt en een server een webpagina terugstuurt stuurt deze informatie mee over zichzelf in de HTTP-headers. De headers die de client naar de server stuurt noemt men de request-headers. De headers die de server naar de client stuurt noemt men de response headers. De request-headers kunnen worden opgevraagd in ASP met de instructie request.servervariables(naam van de header) De headers ALL_RAW en ALL_HTTP bevatten alle informatie uit deze request-headers. De werking van de bv. http-referer header kan je best zien door vanop een andere pagina op een hyperlink te klikken naar deze pagina : surf eens naar linkpagina We gebruiken een for each...next lus om alle serverariabelen op het scherm te brengen. De servervariabele REMOTE_HOST bevat bijvoorbeeld het ip-adres van de aanvrager van de pagina.