Export (0) Print
Expand All

WebHeaderCollection Class

Contains protocol headers associated with a request or response.

For a list of all members of this type, see WebHeaderCollection Members.

System.Object
   System.Collections.Specialized.NameObjectCollectionBase
      System.Collections.Specialized.NameValueCollection
         System.Net.WebHeaderCollection

[Visual Basic]
<Serializable>
<ComVisible(True)>
Public Class WebHeaderCollection
   Inherits NameValueCollection
[C#]
[Serializable]
[ComVisible(true)]
public class WebHeaderCollection : NameValueCollection
[C++]
[Serializable]
[ComVisible(true)]
public __gc class WebHeaderCollection : public
   NameValueCollection
[JScript]
public
   Serializable
 ComVisible(true)
class WebHeaderCollection extends NameValueCollection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The WebHeaderCollection class is generally accessed through WebRequest.Headers or WebResponse.Headers. Some common headers are considered restricted and are either exposed directly by the API (such as Content-Type) or protected by the system and cannot be changed.

The restricted headers are:

  • Accept
  • Connection
  • Content-Length
  • Content-Type
  • Date
  • Expect
  • Host
  • If-Modified-Since
  • Range
  • Referer
  • Transfer-Encoding
  • User-Agent

Requirements

Namespace: System.Net

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

WebHeaderCollection Members | System.Net Namespace

Show:
© 2014 Microsoft