共用方式為


OtherExtensions.GetFirstValueOrNull(HttpHeaders, String) Method

Definition

Gets the first value associated with the supplied header name.

public static string GetFirstValueOrNull (this System.Net.Http.Headers.HttpHeaders headers, string name);
static member GetFirstValueOrNull : System.Net.Http.Headers.HttpHeaders * string -> string
<Extension()>
Public Function GetFirstValueOrNull (headers As HttpHeaders, name As String) As String

Parameters

headers
HttpHeaders

The collection of HTTP headers and their values.

name
String

The header name whose value to get.

Returns

The first value corresponding to the supplied header name, if the name is found in the collection; otherwise, an empty string.

Applies to