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.​HttpContentHeaders
Assembly: System.Net.Http
Inheritance: object → HttpHeaders → HttpContentHeaders
Implemented Interfaces
- Collections.​Generic.​IEnumerable`1 (Inherits: IEnumerable) Implemented by: HttpHeaders
Represents the collection of Content Headers as defined in RFC 2616.
Properties
public
Collections.​Generic.​ICollection<​string>
Allow
Gets the value of the <see langword="Allow" /> content header on an HTTP response.
ContentDisposition
Gets the value of the <see langword="Content-Disposition" /> content header on an HTTP response.
public
Collections.​Generic.​ICollection<​string>
ContentEncoding
Gets the value of the <see langword="Content-Encoding" /> content header on an HTTP response.
public
Collections.​Generic.​ICollection<​string>
ContentLanguage
Gets the value of the <see langword="Content-Language" /> content header on an HTTP response.
public
long?
ContentLength
Gets or sets the value of the <see langword="Content-Length" /> content header on an HTTP response.
public
Uri
ContentLocation
Gets or sets the value of the <see langword="Content-Location" /> content header on an HTTP response.
public
byte[]
ContentMD5
Gets or sets the value of the <see langword="Content-MD5" /> content header on an HTTP response.
public
ContentRangeHeaderValue
ContentRange
Gets or sets the value of the <see langword="Content-Range" /> content header on an HTTP response.
public
MediaTypeHeaderValue
ContentType
Gets or sets the value of the <see langword="Content-Type" /> content header on an HTTP response.
public
DateTimeOffset?
Expires
Gets or sets the value of the <see langword="Expires" /> content header on an HTTP response.
public
DateTimeOffset?
LastModified
Gets or sets the value of the <see langword="Last-Modified" /> content header on an HTTP response.
public
HttpHeadersNonValidated
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.
public
Collections.​Generic.​IEnumerator<​Collections.​Generic.​KeyValuePair<​string, Collections.​Generic.​IEnumerable<​string>>>
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" /> .
public
Collections.​Generic.​IEnumerable<​string>
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
protected
object
MemberwiseClone​()
Inherited from object