Share via


ServiceClientOptions interface

建立用戶端時提供的選項。

Extends

屬性

baseUri

如果指定,這是此 ServiceClient 將針對此 ServiceClient 提出要求的基底 URI。 如果未指定,則所有 OperationSpecs 都必須包含 baseUrl 屬性。

credential

用來驗證要求的認證。

credentialScopes

如果指定,將會用來建置 BearerTokenAuthenticationPolicy。

endpoint

如果指定,這是針對這個 ServiceClient 要求所針對的端點。 如果未指定,則所有 OperationSpecs 都必須包含 baseUrl 屬性。 為了鼓勵客戶使用端點,我們會將 baseUri 標示為已被取代。

pipeline

要使用的自訂管線,否則會建立預設管線。

requestContentType

服務的預設要求內容類型。 如果 OperationSpec 上沒有 requestContentType,則會使用 。

繼承的屬性

additionalPolicies

要包含在 HTTP 管線中的其他原則。

allowInsecureConnection

如果要求是透過 HTTP 傳送,而不是 HTTPS,請將 設定為 true

httpClient

將用來傳送 HTTP 要求的 HttpClient。

proxyOptions

設定傳出要求的 Proxy 選項。

redirectOptions

重新導向回應處理方式的選項。

retryOptions

控制如何重試失敗要求的選項。

telemetryOptions

將一般遙測和追蹤資訊設定為傳出要求的選項。

tlsOptions

設定 TLS 驗證的選項

userAgentOptions

將使用者代理程式詳細資料新增至傳出要求的選項。

屬性詳細資料

baseUri

警告

此 API 現已淘汰。

This property is deprecated and will be removed soon, please use endpoint instead

如果指定,這是此 ServiceClient 將針對此 ServiceClient 提出要求的基底 URI。 如果未指定,則所有 OperationSpecs 都必須包含 baseUrl 屬性。

baseUri?: string

屬性值

string

credential

用來驗證要求的認證。

credential?: TokenCredential

屬性值

credentialScopes

如果指定,將會用來建置 BearerTokenAuthenticationPolicy。

credentialScopes?: string | string[]

屬性值

string | string[]

endpoint

如果指定,這是針對這個 ServiceClient 要求所針對的端點。 如果未指定,則所有 OperationSpecs 都必須包含 baseUrl 屬性。 為了鼓勵客戶使用端點,我們會將 baseUri 標示為已被取代。

endpoint?: string

屬性值

string

pipeline

要使用的自訂管線,否則會建立預設管線。

pipeline?: Pipeline

屬性值

requestContentType

服務的預設要求內容類型。 如果 OperationSpec 上沒有 requestContentType,則會使用 。

requestContentType?: string

屬性值

string

繼承的屬性詳細資料

additionalPolicies

要包含在 HTTP 管線中的其他原則。

additionalPolicies?: AdditionalPolicyConfig[]

屬性值

繼承自CommonClientOptions.additionalPolicies

allowInsecureConnection

如果要求是透過 HTTP 傳送,而不是 HTTPS,請將 設定為 true

allowInsecureConnection?: boolean

屬性值

boolean

繼承自CommonClientOptions.allowInsecureConnection

httpClient

將用來傳送 HTTP 要求的 HttpClient。

httpClient?: HttpClient

屬性值

繼承自CommonClientOptions.HTTPClient

proxyOptions

設定傳出要求的 Proxy 選項。

proxyOptions?: ProxySettings

屬性值

繼承自CommonClientOptions.proxyOptions

redirectOptions

重新導向回應處理方式的選項。

redirectOptions?: RedirectPolicyOptions

屬性值

繼承自CommonClientOptions.redirectOptions

retryOptions

控制如何重試失敗要求的選項。

retryOptions?: PipelineRetryOptions

屬性值

繼承自CommonClientOptions.retryOptions

telemetryOptions

將一般遙測和追蹤資訊設定為傳出要求的選項。

telemetryOptions?: TelemetryOptions

屬性值

繼承自CommonClientOptions.telemetryOptions

tlsOptions

設定 TLS 驗證的選項

tlsOptions?: TlsSettings

屬性值

繼承自CommonClientOptions.tlsOptions

userAgentOptions

將使用者代理程式詳細資料新增至傳出要求的選項。

userAgentOptions?: UserAgentPolicyOptions

屬性值

繼承自CommonClientOptions.userAgentOptions