Mono Class Library: System.Net.WebHeaderCollection Overview | Members

System.Net.WebHeaderCollection.IsRestricted Method

Returns a bool value that indicates whether the specified HTTP header can be set. [Edit]

public static bool IsRestricted (string headerName)

Parameters

headerName
A string containing the header to test. [Edit]

Returns

true if the header is protected; otherwise false . [Edit]

Exceptions

TypeReason
ArgumentNullExceptionheaderName is null or string.Empty. [Edit]
ArgumentExceptionheaderName contains invalid characters. [Edit]

Remarks

This method returns true to indicate that a header is protected. Protected headers can only be set through provided property accessors or by the system. They cannot be set directly in the current instance.

The protected headers are:

  • Accept
  • Connection
  • Content-Length
  • Content-Type
  • Date
  • Expect
  • Host
  • If-Modified-Since
  • Range
  • Referer
  • Transfer-Encoding
  • UserAgent
[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0