Getting all http headers

  • Thread starter Thread starter Arthur Yousif
  • Start date Start date
A

Arthur Yousif

Hi,
I'm just starting out on ASP.NET, although I'm not new to
programming. I'm in a crunch and have been all over the
documentation and MSDN and searching this newsgroup with
no luck finding the info I'm looking for.

Basically, I'm creating my own custom header and using
Response.AppendHeader("MyHeader", myVal) and then I've
tried calling my test page using Response.Redirect,
Response.Write, and Response.BinaryWrite, which all work,
however, on my test page when I read all the Headers from
the Request.Headers collection, I never see my custom
headers.

Any help would be greatly appreciated. Am I even doing
this correctly? I know I can create a form with hidden
fields and post the page, but I'm wanting to include this
in the header in this case. Thank you.

Arthur
 
Thanks Michal. I'm curious, the following code works with Response though.

Response.AppendHeader("content-disposition",
"attachment; filename=myfile.pdf");

Response.ContentType = "application/octet-inputStream";

When I do a Response.BinaryWrite(myBinaryBuffer) the browser correctly
handles it and opens the Save dialog. Also, even though you can append
headers to a Response object, I don't see it having a Headers collection
like the Request object.
 
Back
Top