Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Net.​Http.​Headers.​HttpRequestHeaders

Assembly: System.Net.Http

Inheritance: object → HttpHeaders → HttpRequestHeaders

Implemented Interfaces

Represents the collection of Request Headers as defined in RFC 2616.

Properties

Gets the value of the <see langword="Accept" /> header for an HTTP request.
Gets the value of the <see langword="Accept-Charset" /> header for an HTTP request.
Gets the value of the <see langword="Accept-Encoding" /> header for an HTTP request.
Gets the value of the <see langword="Accept-Language" /> header for an HTTP request.
Authorization
Gets or sets the value of the <see langword="Authorization" /> header for an HTTP request.
CacheControl
Gets or sets the value of the <see langword="Cache-Control" /> header for an HTTP request.
public HttpHeaderValueCollection<​string>
Connection
Gets the value of the <see langword="Connection" /> header for an HTTP request.
public bool?
ConnectionClose
Gets or sets a value that indicates if the <see langword="Connection" /> header for an HTTP request contains Close.
public DateTimeOffset?
Date
Gets or sets the value of the <see langword="Date" /> header for an HTTP request.
Gets the value of the <see langword="Expect" /> header for an HTTP request.
public bool?
ExpectContinue
Gets or sets a value that indicates if the <see langword="Expect" /> header for an HTTP request contains Continue.
public string
From
Gets or sets the value of the <see langword="From" /> header for an HTTP request.
public string
Host
Gets or sets the value of the <see langword="Host" /> header for an HTTP request.
Gets the value of the <see langword="If-Match" /> header for an HTTP request.
public DateTimeOffset?
IfModifiedSince
Gets or sets the value of the <see langword="If-Modified-Since" /> header for an HTTP request.
Gets the value of the <see langword="If-None-Match" /> header for an HTTP request.
IfRange
Gets or sets the value of the <see langword="If-Range" /> header for an HTTP request.
public DateTimeOffset?
IfUnmodifiedSince
Gets or sets the value of the <see langword="If-Unmodified-Since" /> header for an HTTP request.
public int?
MaxForwards
Gets or sets the value of the <see langword="Max-Forwards" /> header for an HTTP request.
Gets the value of the <see langword="Pragma" /> header for an HTTP request.
public string
Protocol
Gets or sets the value of the <see langword=":protocol" /> pseudo-header for an HTTP request.
ProxyAuthorization
Gets or sets the value of the <see langword="Proxy-Authorization" /> header for an HTTP request.
Range
Gets or sets the value of the <see langword="Range" /> header for an HTTP request.
public Uri
Referrer
Gets or sets the value of the <see langword="Referer" /> header for an HTTP request.
Gets the value of the <see langword="TE" /> header for an HTTP request.
public HttpHeaderValueCollection<​string>
Trailer
Gets the value of the <see langword="Trailer" /> header for an HTTP request.
Gets the value of the <see langword="Transfer-Encoding" /> header for an HTTP request.
public bool?
TransferEncodingChunked
Gets or sets a value that indicates if the <see langword="Transfer-Encoding" /> header for an HTTP request contains chunked.
Gets the value of the <see langword="Upgrade" /> header for an HTTP request.
Gets the value of the <see langword="User-Agent" /> header for an HTTP request.
Gets the value of the <see langword="Via" /> header for an HTTP request.
Gets the value of the <see langword="Warning" /> header for an HTTP request.
NonValidated
Gets a view of the contents of this headers collection that does not parse nor validate the data upon access.

Methods

public void
Add​(string name, Collections.​Generic.​IEnumerable<​string> values)
Inherited from HttpHeaders
Adds the specified header and its values into the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
name The header to add to the collection.
values A list of header values to add to the collection.
public void
Add​(string name, string value)
Inherited from HttpHeaders
Adds the specified header and its value into the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
name The header to add to the collection.
value The content of the header.
public void
Clear​()
Inherited from HttpHeaders
Removes all headers from the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
public bool
Contains​(string name)
Inherited from HttpHeaders
Returns if a specific header exists in the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
Returns <see langword="true" /> if the specified header exists in the collection; otherwise <see langword="false" /> .
name The specific header.
GetEnumerator​()
Inherited from HttpHeaders
Returns an enumerator that can iterate through the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> instance.
Returns An enumerator for the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> .
GetValues​(string name)
Inherited from HttpHeaders
Returns all header values for a specified header stored in the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
Returns An array of header strings.
name The specified header to return values for.
public bool
Remove​(string name)
Inherited from HttpHeaders
Removes the specified header from the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection.
Returns <see langword="true" /> if <paramref name="name" /> is successfully removed; otherwise, <see langword="false" /> . This method also returns <see langword="false" /> if <paramref name="name" /> was not found in the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection or if <paramref name="name" /> is <see langword="null" /> .
name The name of the header to remove from the collection.
public string
ToString​()
Inherited from HttpHeaders
Returns a string that represents the current <see cref="T:System.Net.Http.Headers.HttpHeaders" /> object.
Returns A string that represents the current object.
public bool
TryAddWithoutValidation​(string name, Collections.​Generic.​IEnumerable<​string> values)
Inherited from HttpHeaders
Returns a value that indicates whether the specified header and its values were added to the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection without validating the provided information.
Returns <see langword="true" /> if the specified header <paramref name="name" /> and <paramref name="values" /> could be added to the collection; otherwise <see langword="false" /> .
name The header to add to the collection.
values The values of the header.
public bool
TryAddWithoutValidation​(string name, string value)
Inherited from HttpHeaders
Returns a value that indicates whether the specified header and its value were added to the <see cref="T:System.Net.Http.Headers.HttpHeaders" /> collection without validating the provided information.
Returns <see langword="true" /> if the specified header <paramref name="name" /> and <paramref name="value" /> could be added to the collection; otherwise <see langword="false" /> .
name The header to add to the collection.
value The content of the header.
public bool
TryGetValues​(string name, Collections.​Generic.​IEnumerable`1&? values)
Inherited from HttpHeaders
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object