• Welcome to Valhalla Legends Archive.
 

Changing header data on IIS with ASP

Started by Spht, February 03, 2006, 09:19 PM

Previous topic - Next topic

Spht

I need to change the HTTP headers for a ASP page I'm working on.  Specifically, Connection needs to be changed from Keep-Alive (which is what it's defaulting to) to close.  Also, Content-Type needs to be changed.

Edit: PHP's header() seems to let you do this.  Is there ASP equivilent?

Answer:  Response.ContentType for changing Content-Type and Response.AddHeader "Connecton" can be used for adding that header (note it does not overwrite matching header).

Grok

To write, use Response.AddHeader:
<% Response.AddHeader "CustomHeader", "CustomValue" %>

To read:
<% ReturnedValue = Request.ServerVariables("HTTP_CustomHeader") %>

Found this in Platform SDK help, did not test it myself.