HttpClientBuilderExtensions.RedactLoggedHeaders 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>) |
設定應在記錄前修訂其值的 HTTP 標頭名稱集合。 |
RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>) |
設定 Func<T,TResult>,其可決定是否在記錄前先修訂 HTTP 標頭值。 |
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>)
設定 Func<T,TResult>,其可決定是否在記錄前先修訂 HTTP 標頭值。
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
Func<T,TResult>,其可決定是否在記錄前先修訂 HTTP 標頭值。
傳回
備註
記錄時,會針對每個標頭值評估提供的 shouldRedactHeaderValue
述詞。 如果述詞傳回 true
,則標頭值將會取代為記錄中的標記值 *
;否則會記錄標頭值。