Open In App

ASP AddHeader Method

The ASP AddHeader Method is used to specify for adding a new named for the HTTP Header and provide and given a value to the HTTP Response. It is a method of a Response type Object. 

Syntax:



response.AddHeader name,value

 Parameter Values: This method accepts two parameters as mentioned above and described below:

 Return Values: This method has not returned any value. 



 Example 1:

<% Response.AddHeader "WARNING","Error message text %>

   

Example 2: Below code uses the AddHeader method to request that the client use Basic authentication.

<% Response.Addheader "WWW-Authenticate", "BASIC" %>

Example 3:  

<% Response.AddHeader "CustomHeader", "CustomValue" %>

Reference: https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms524327(v=vs.90)

Article Tags :