HttpClientBuilderExtensions.RedactLoggedHeaders 方法

定义

重载

RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)

设置其值应在记录之前进行修正的 HTTP 标头名称的集合。

RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)

设置用于确定是否在记录之前修正 HTTP 标头值的 Func<T,TResult>

RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

设置其值应在记录之前进行修正的 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

参数

redactedLoggedHeaderNames
IEnumerable<String>

其值应在记录之前进行修正的 HTTP 标头名称的集合。

返回

IHttpClientBuilder

适用于

RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

设置用于确定是否在记录之前修正 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

参数

shouldRedactHeaderValue
Func<String,Boolean>

用于确定是否在记录之前修正 HTTP 标头值的 Func<T,TResult>

返回

IHttpClientBuilder

注解

日志记录时,将为每个标头值计算提供的 shouldRedactHeaderValue 谓词。 如果谓词返回 true ,则将标头值替换为日志中的标记值 * ;否则将记录标头值。

适用于