470,638 Members | 1,579 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,638 developers. It's quick & easy.

Request.ServerVariables Question

Hi,

I've got a question regarding the usage of Request.ServerVariables.
I'm not sure this is really a ASP question, so redirects to a more
appropriate newsgroup are welcome.

I have a variable that is being passed to me through HTTP headers
called "Test." I am able to see this variable and its value when I use
Request.ServerVariables("ALL_HTTP"). Additionally, when I iterate
through Request.ServerVariables using a "For Each key in
Request.ServerVariables" the key of "Test" comes up. However, when I
use Request.ServerVariables("Test"), the value returned to me is
always empty. One workaround thats been suggested by the person
sending me the header is to simply parse the contents of "ALL_HTTP" to
retrieve the data I want. This is doable, but I'm curious to know why
exactly the value of Request.ServerVariables("Test") comes up empty
when I can plainly see there is a value in the "ALL_HTTP" dump?

Thanks in advance!
Jul 19 '05 #1
2 6497
The ALL_HTTP info is news to me, but this should answer why there isn't a
custom header:

http://www.aspfaq.com/2261


"W. Loo" <wl****@hotmail.com> wrote in message
news:33**************************@posting.google.c om...
Hi,

I've got a question regarding the usage of Request.ServerVariables.
I'm not sure this is really a ASP question, so redirects to a more
appropriate newsgroup are welcome.

I have a variable that is being passed to me through HTTP headers
called "Test." I am able to see this variable and its value when I use
Request.ServerVariables("ALL_HTTP"). Additionally, when I iterate
through Request.ServerVariables using a "For Each key in
Request.ServerVariables" the key of "Test" comes up. However, when I
use Request.ServerVariables("Test"), the value returned to me is
always empty. One workaround thats been suggested by the person
sending me the header is to simply parse the contents of "ALL_HTTP" to
retrieve the data I want. This is doable, but I'm curious to know why
exactly the value of Request.ServerVariables("Test") comes up empty
when I can plainly see there is a value in the "ALL_HTTP" dump?

Thanks in advance!

Jul 19 '05 #2
"W. Loo" <wl****@hotmail.com> wrote in message
news:33**************************@posting.google.c om...
Hi,

I've got a question regarding the usage of Request.ServerVariables.
I'm not sure this is really a ASP question, so redirects to a more
appropriate newsgroup are welcome.

I have a variable that is being passed to me through HTTP headers
called "Test." I am able to see this variable and its value when I use
Request.ServerVariables("ALL_HTTP"). Additionally, when I iterate
through Request.ServerVariables using a "For Each key in
Request.ServerVariables" the key of "Test" comes up. However, when I
use Request.ServerVariables("Test"), the value returned to me is
always empty. One workaround thats been suggested by the person
sending me the header is to simply parse the contents of "ALL_HTTP" to
retrieve the data I want. This is doable, but I'm curious to know why
exactly the value of Request.ServerVariables("Test") comes up empty
when I can plainly see there is a value in the "ALL_HTTP" dump?

Thanks in advance!


Any variables not natively enumerated into the ServerVariables
collection should be accessed by prefixing with "HTTP_" or "HEADER_". In
your case:

Request.ServerVariables("HTTP_Test")

Here's a link to the documentation for the ServerVariables collection
http://msdn.microsoft.com/library/en...om_reqocsv.asp

HTH
-Chris Hohmann
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by TS | last post: by
8 posts views Thread by nsyforce | last post: by
2 posts views Thread by Henry Stock | last post: by
1 post views Thread by Korara | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.