Returns a bool value that indicates whether the specified HTTP header can be set.
- headerName
- A string containing the header to test.
true if the header is protected; otherwise false .
Type Reason ArgumentNullException headerName is null or string.Empty. ArgumentException headerName contains invalid characters.
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
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0