HttpClientBuilderExtensions.RedactLoggedHeaders 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>) |
设置其值应在记录之前进行修正的 HTTP 标头名称的集合。 |
RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>) |
设置用于确定是否在记录之前修正 HTTP 标头值的 Func<T,TResult>。 |
RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)
设置其值应在记录之前进行修正的 HTTP 标头名称的集合。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ RedactLoggedHeaders(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::Collections::Generic::IEnumerable<System::String ^> ^ redactedLoggedHeaderNames);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder RedactLoggedHeaders (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Collections.Generic.IEnumerable<string> redactedLoggedHeaderNames);
static member RedactLoggedHeaders : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * seq<string> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function RedactLoggedHeaders (builder As IHttpClientBuilder, redactedLoggedHeaderNames As IEnumerable(Of String)) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
- redactedLoggedHeaderNames
- IEnumerable<String>
其值应在记录之前进行修正的 HTTP 标头名称的集合。
返回
适用于
RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)
设置用于确定是否在记录之前修正 HTTP 标头值的 Func<T,TResult>。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ RedactLoggedHeaders(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Func<System::String ^, bool> ^ shouldRedactHeaderValue);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder RedactLoggedHeaders (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Func<string,bool> shouldRedactHeaderValue);
static member RedactLoggedHeaders : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Func<string, bool> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function RedactLoggedHeaders (builder As IHttpClientBuilder, shouldRedactHeaderValue As Func(Of String, Boolean)) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
用于确定是否在记录之前修正 HTTP 标头值的 Func<T,TResult>。
返回
注解
日志记录时,将为每个标头值计算提供的 shouldRedactHeaderValue
谓词。 如果谓词返回 true
,则将标头值替换为日志中的标记值 *
;否则将记录标头值。