Class HttpResponseHeadersExtensions
The HttpResponseHeadersExtensions class adds extension methods to the HttpResponseHeaders class.
Inheritance
System.Object
HttpResponseHeadersExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Social.Common.Rest
Assembly: EPiServer.Social.Common.Rest.dll
Version: 1.5.4Syntax
public static class HttpResponseHeadersExtensions
Methods
GetValue<T>(HttpResponseHeaders, String, T)
Safely gets a single value for the identified header. If a value cannot be retrieved, the specified default value will be returned.
Declaration
public static T GetValue<T>(this HttpResponseHeaders headers, string name, T defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Net.Http.Headers.HttpResponseHeaders | headers | Header collection |
| System.String | name | Identifies the name of the header whose value should be retrieved |
| T | defaultValue | Default value for the header |
Returns
| Type | Description |
|---|---|
| T | Value of the identified header |
Type Parameters
| Name | Description |
|---|---|
| T | Data type of header value to retrieve |