你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
OtherExtensions.GetFirstValueOrNull(HttpHeaders, String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与提供的标头名称关联的第一个值。
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
参数
- headers
- HttpHeaders
HTTP 标头及其值的集合。
- name
- String
要获取其值的标头名称。
返回
如果集合中找到该名称,则为与提供的标头名称对应的第一个值;否则为空字符串。