Simon said:
Hi
I am trying to read the html header 'if modified since' by using
Request.ServerVariables("HTTP_IF_MODIFIED_SINCE") in classic ASP. But I am
unable to get anything from this, this variable is always empty. It is also
excluded when I try to list all the server variables. We are using IIS6.
So please can someone confirm what is the correct syntax?
Ok mucho confusion in this thread I clear that up first.
All headers that are included in the request are accessible to code via the
ServerVariables accessor. IIS does some additional things with headers and
creates a set of other named variables such as URL and also adds things that
have nothing to do with headers such as REMOTE_ADDR.
IIS does some tranforms on the name of a header before making it available.
It Prepends HTTP_, makes all the characters upper case and it converts any
hyphens to underscore. Hence if a client sends the header x-pink-elephants
it can be access as HTTP_X_PINK_ELEPHANTS.
The If-Modified-Since header is a standard header but it isn't always
supplied.
A HTTP server when responding to a request may include in the response a
Last-Modified header. When a client such as IE makes a subsequent request
for the _same_ URL it would normally include the If-Modified-Since request
header.
(Side note: a user can suppress the sending of the If-Modified-Since and the
If-None-Match headers by refreshing using Ctrl-F5 in IE).
Active Server Script generated pages would not send a Last-Modified header
in the response unless the developer deliberately created and added it to
the response themselves. Hence you are not seeing a If-Modified-Since
header.
What is it you want to do with this header? Generate a 304 response?