Solved

How do I append a custom header and then retrieve it?

Posted on 2009-04-10
2
197 Views
Last Modified: 2013-11-19
I am having all kinds of problems with something that should be fairly straight forward and simple.  I want to add a custom header using Request.AppendHeader(name, value) then when the page is displayed be able to get the custom header.  But when I try it I get an error that object not set to instance of object error.  See code below.  Really need help not a link to some other page which doesn't answer the question.  Must have viewed 100 of them.
Here is where I append the header

Response.AppendHeader("ReserveHeader", "navyreserve.navy.mil");              Response.Redirect(sbURL.ToString());

              

  This line throws the error on the page cited in sbURL

string Header = Request.ServerVariables["HTTP_ReserveHeader"].ToString();

Open in new window

0
Comment
Question by:mbart
2 Comments
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 24120988
What you are trying to do is not possible.  Server-side code, like ASP, is only processed on the server, and client-side JavaScript can't access most HTTP headers.
0
 

Author Closing Comment

by:mbart
ID: 31569059
Thanks, afraid of that. Will follow-up with another question along the same lines.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn how to dynamically set the form action using jQuery.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now