HttpHeadersExtensions.GetFirstOrDefault<TType> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the first HTTP header or default value.
public static TType GetFirstOrDefault<TType> (this System.Net.Http.Headers.HttpHeaders headers, string name, Func<string,TType> transform, TType defaultValue = default);
static member GetFirstOrDefault : System.Net.Http.Headers.HttpHeaders * string * Func<string, 'ype> * 'ype -> 'ype
<Extension()>
Public Function GetFirstOrDefault(Of TType) (headers As HttpHeaders, name As String, transform As Func(Of String, TType), Optional defaultValue As TType = Nothing) As TType
Type Parameters
- TType
The type of the object housed in the header.
Parameters
- headers
- HttpHeaders
The HTTP headers.
- name
- String
The header name.
- defaultValue
- TType
The default value.
Returns
TType