I was wondering if its possible to add custom header with classic asp. In other words, I am looking for classic asp equivalent of .net's Response.AddHeader().
i.e.
HttpContext.Response.AddHeader("customheadertruefalse","1");
In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.
Adding Custom Header for Individual Response We create a very basic HTTP GET endpoint. Within this endpoint, we access the Response object through the HttpContext object. Then, we add a new header, with the name of x-my-custom-header and a value of individual response .
To add custom headers to an HTTP request object, use the AddHeader() method. You can use this method multiple times to add multiple headers. For example: oRequest = RequestBuilder:Build('GET', oURI) :AddHeader('MyCustomHeaderName','MyCustomHeaderValue') :AddHeader('MySecondHeader','MySecondHeaderValue') :Request.
The AddHeader method adds a new HTML header and value to the response sent to the client. It does not replace an existing header of the same name. After a header has been added, it cannot be removed.
Use Response.AddHeader
(as JohnFx already answered).
Here is sample from one of my working asp pages :
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=ranking-export.csv"
Don't mean to be that guy, but have you tried Response.AddHeader?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With