
AppendHeader | 375
HttpResponse
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
AddHeader
Response.AddHeader(ByVal name As String, ByVal value As String)
Adds an HTTP header with the specified name and value to the output stream.
Parameters
name
A String argument containing the name for the header.
value
A String argument containing the value for the header.
Notes
The AddHeader property provides for backward compatibility with classic ASP.
This property has been deprecated in favor of the new AppendHeader method.
AppendHeader
Response.AppendHeader(ByVal name As String, _
ByVal value As String)
Adds an HTTP header with the specified name and value to the output stream.
This method can be used to add custom HTTP headers or to modify the value of
standard HTTP headers.
Parameters
name
A String argument containing the name for the header.
value
A String argument containing the value for the header.
Example
The example sets the HTTP Content-Type header to "text/xml" and then displays
the new value by setting the Text property of the Message Label control to the
value of the ContentType property. This causes the page output to be treated as
XML.
Sub Page_Load( )
Response.AppendHeader("Content-Type", "text/xml")
Message.Text = Response.ContentType
End Sub
Notes
When using this method with HTTP headers related to caching policy, if more
restrictive ...