Re: Making a HttpHeader persist.

From: Tim (Tim_at_discussions.microsoft.com)
Date: 09/01/04


Date: Wed, 1 Sep 2004 12:41:02 -0700

Hey Kevin,
  Thanks for explaining that.

Tim

"Kevin Spencer" wrote:

> > I'd appreciate any advice on how to generate a Request Header for testing
> > purposes.
>
> That would be done by modifying the client browser configuration somehow.
> How, I'm not sure.
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Tim" <Tim@discussions.microsoft.com> wrote in message
> news:FC769873-080E-42AA-8A76-1EDE80CDE8EA@microsoft.com...
> > Hello,
> > Thank you for the posts.
> > > Who is going to tell the browser to add it?
> > I did not realize this (I incorrectly thought that the Response header
> would
> > automatically "stick around" and be appended to the Request header). Thank
> > you for pointing that out.
> >
> > > if you can tell us what you're trying to achieve
> > I am making a sub-app whose security is managed by a system that sends
> > info through the http headers (I did not make this security system). For
> > example, every request might contain a header "AB_User" that I need to
> read.
> > For testing and development purposes I am trying to stub out that security
> > system by autogenerating my own matching header. Right now because our app
> > isn't under that security system yet, there are no headers, and I cannot
> test
> > it.
> >
> > I'd appreciate any advice on how to generate a Request Header for testing
> > purposes.
> >
> > Thanks again,
> > Tim
> >
> >
> > "Kevin Spencer" wrote:
> >
> > > A header is part of an HTTP message. When you add a header on the server
> > > side, you are adding it to the Response. Your new header is IN that
> Response
> > > message. What you get back from the client is a Request. Your new header
> is
> > > NOT part of the Request sent by the browser. Who is going to tell the
> > > browser to add it?
> > >
> > > Also note that you are reading from the Request Headers, and you
> inserted
> > > the value into the Response headers. Because of the nature of these
> headers,
> > > you can no more write to the Request headers than I can change your
> posted
> > > message. It is a Request. The browser is doing the Requesting. Not the
> > > server. IOW, unlike Cookies, the Response and Request headers are 2
> entirely
> > > different Collections.
> > >
> > > Finally, if you can tell us what you're trying to achieve, in terms of
> > > business requirements, I think we can suggest a workable alternative.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "Tim" <Tim@discussions.microsoft.com> wrote in message
> > > news:5A39D56B-D14E-4BEB-9C4D-07761F358805@microsoft.com...
> > > > Hello,
> > > > I add a header to the response in the page_load, like so:
> > > >
> > > > Me.Response.AppendHeader("NewHeader", "NewValue")
> > > >
> > > > However when I try to get that header on any subsequent event (like
> > > clicking
> > > > a button), it doesn't appear. For example the following returns an
> empty
> > > > string:
> > > > Me.Request.Headers.Get("NewHeader")
> > > >
> > > > Does anyone know why this is? How can I add a header, and then get it?
> > > >
> > > > Thanks for any help,
> > > > Tim
> > >
> > >
> > >
>
>
>