System::Net::WebHeaderCollection class

WebHeaderCollection class

Represents the collection of the protocol headers. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class WebHeaderCollection : public System::Object

Methods

MethodDescription
Add(String, String)Adds the specified pair of the header name and the header value to the collection.
Add(HttpResponseHeader, String)Adds the specified pair of the header and the header value to the collection.
Add(HttpRequestHeader, String)Adds the specified pair of the header and the header value to the collection.
AllKeys()Returns a collection of header names that are stored in the collection.
get_Count() constReturns a number of elements in the collection.
get_Keys()Returns a collection of header names that are stored in the collection.
GetKey(int)Returns a key at the specified index.
GetValues(String)Returns the collection of the header values.
idx_get(HttpRequestHeader)Gets the header value using the specified request’s header.
idx_get(HttpResponseHeader)Gets the header value using the specified response’s header.
idx_get(String)Gets the header value using the specified header name.
idx_set(HttpRequestHeader, String)Sets the header value of the specified header.
idx_set(HttpResponseHeader, String)Sets the header value using the specified response’s header.
idx_set(String, String)Sets the header value using the specified header name.
static IsRestricted(const String&)Tests whether the specified HTTP header can be set for the request.
Remove(String)Removes the header by the specified header name.
Remove(HttpResponseHeader)Removes the specified response’s header.
Remove(HttpRequestHeader)Removes the specified request’s header.
Set(String, String)Sets the value of the specified header.
ToString() const overrideAnalog of C# Object.ToString() method. Enables converting custom objects to string.
WebHeaderCollection()Constructs a new instance.

See Also