Back to product page

Add method


Adds new header to the collection.

Type

WebHeader object

Syntax

  • Basic
object.Add (Name, [Value])
The Add(object,Name,Value) syntax has these parts:
objectAn expression evaluating to an object of type WebHeaders
NameA String value. Holds header name.
ValueOptional. A Variant value. Holds header value.
Return valueWebHeader object

Remarks

Add method will add new header to the collection of all headers, usually for Response object (Request is populated by the client).

To add new header, you can use code like this:
 
User.Response.Headers.Add "Content-Type", "text/html"
 

or even easier
 
User.Response.Headers("Content-Type") = "text/html" ' (only available in some environments, such as VB)

Add method will return reference to created WebHeader object, which can be ignored.

Platforms

Windows