HeaderParsingHttpRequestExtensions.TryGetHeaderValue 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.
Overloads
TryGetHeaderValue<T>(HttpRequest, HeaderKey<T>, T) |
Tries to get a header value if it exists and can be parsed. |
TryGetHeaderValue<T>(HttpRequest, HeaderKey<T>, T, ParsingResult) |
Tries to get a header value if it exists and can be parsed. |
TryGetHeaderValue<T>(HttpRequest, HeaderKey<T>, T)
Tries to get a header value if it exists and can be parsed.
public static bool TryGetHeaderValue<T> (this Microsoft.AspNetCore.Http.HttpRequest request, Microsoft.AspNetCore.HeaderParsing.HeaderKey<T> header, out T? value);
static member TryGetHeaderValue : Microsoft.AspNetCore.Http.HttpRequest * Microsoft.AspNetCore.HeaderParsing.HeaderKey<'T> * 'T -> bool
<Extension()>
Public Function TryGetHeaderValue(Of T) (request As HttpRequest, header As HeaderKey(Of T), ByRef value As T) As Boolean
Type Parameters
- T
The type of the header value.
Parameters
- request
- HttpRequest
The HttpRequest instance.
- header
- HeaderKey<T>
The header to parse.
- value
- T
A resulting value.
Returns
true
if the header value was successfully fetched parsed.
Applies to
TryGetHeaderValue<T>(HttpRequest, HeaderKey<T>, T, ParsingResult)
Tries to get a header value if it exists and can be parsed.
public static bool TryGetHeaderValue<T> (this Microsoft.AspNetCore.Http.HttpRequest request, Microsoft.AspNetCore.HeaderParsing.HeaderKey<T> header, out T? value, out Microsoft.AspNetCore.HeaderParsing.ParsingResult result);
static member TryGetHeaderValue : Microsoft.AspNetCore.Http.HttpRequest * Microsoft.AspNetCore.HeaderParsing.HeaderKey<'T> * 'T * ParsingResult -> bool
<Extension()>
Public Function TryGetHeaderValue(Of T) (request As HttpRequest, header As HeaderKey(Of T), ByRef value As T, ByRef result As ParsingResult) As Boolean
Type Parameters
- T
The type of the header value.
Parameters
- request
- HttpRequest
The HttpRequest instance.
- header
- HeaderKey<T>
The header to parse.
- value
- T
A resulting value.
- result
- ParsingResult
Details on the parsing operation.
Returns
true
if the header value was successfully fetched parsed.