azure-docs-sdk-java/docs-ref-autogen/com.azure.core.client.trait...

113 строки
17 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.client.traits.HttpTrait"
fullName: "com.azure.core.client.traits.HttpTrait<T>"
name: "HttpTrait<T>"
nameWithType: "HttpTrait<T>"
summary: "An <xref uid=\"com.azure.core.client.traits\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Azure SDK for Java trait\"></xref> providing a consistent interface for configuration of HTTP-specific settings."
syntax: "public interface **HttpTrait<T>**"
methods:
- uid: "com.azure.core.client.traits.HttpTrait.addPolicy(com.azure.core.http.policy.HttpPipelinePolicy)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.addPolicy(HttpPipelinePolicy pipelinePolicy)"
name: "addPolicy(HttpPipelinePolicy pipelinePolicy)"
nameWithType: "HttpTrait<T>.addPolicy(HttpPipelinePolicy pipelinePolicy)"
summary: "Adds a <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"pipeline policy\"></xref> to apply on each request sent."
modifiers:
- "abstract"
parameters:
- description: "A <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"pipeline policy\"></xref>."
name: "pipelinePolicy"
type: "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T addPolicy(HttpPipelinePolicy pipelinePolicy)"
desc: "Adds a <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"pipeline policy\"></xref> to apply on each request sent.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.client.traits.HttpTrait.clientOptions(com.azure.core.util.ClientOptions)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.clientOptions(ClientOptions clientOptions)"
name: "clientOptions(ClientOptions clientOptions)"
nameWithType: "HttpTrait<T>.clientOptions(ClientOptions clientOptions)"
summary: "Allows for setting common properties such as application ID, headers, proxy configuration, etc."
modifiers:
- "abstract"
parameters:
- description: "A configured instance of <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref>."
name: "clientOptions"
type: "<xref href=\"com.azure.core.util.ClientOptions?alt=com.azure.core.util.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T clientOptions(ClientOptions clientOptions)"
desc: "Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is recommended that this method be called with an instance of the <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref> class (a subclass of the <xref uid=\"com.azure.core.util.ClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientOptions\"></xref> base class). The HttpClientOptions subclass provides more configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait interface.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.client.traits.HttpTrait.httpClient(com.azure.core.http.HttpClient)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.httpClient(HttpClient httpClient)"
name: "httpClient(HttpClient httpClient)"
nameWithType: "HttpTrait<T>.httpClient(HttpClient httpClient)"
summary: "Sets the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> to use for sending and receiving requests to and from the service."
modifiers:
- "abstract"
parameters:
- description: "The <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> to use for requests."
name: "httpClient"
type: "<xref href=\"com.azure.core.http.HttpClient?alt=com.azure.core.http.HttpClient&text=HttpClient\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T httpClient(HttpClient httpClient)"
desc: "Sets the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> to use for sending and receiving requests to and from the service.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.client.traits.HttpTrait.httpLogOptions(com.azure.core.http.policy.HttpLogOptions)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.httpLogOptions(HttpLogOptions logOptions)"
name: "httpLogOptions(HttpLogOptions logOptions)"
nameWithType: "HttpTrait<T>.httpLogOptions(HttpLogOptions logOptions)"
summary: "Sets the <xref uid=\"com.azure.core.http.policy.HttpLogOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"logging configuration\"></xref> to use when sending and receiving requests to and from the service."
modifiers:
- "abstract"
parameters:
- description: "The <xref uid=\"com.azure.core.http.policy.HttpLogOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"logging configuration\"></xref> to use when sending and receiving requests to\n and from the service."
name: "logOptions"
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T httpLogOptions(HttpLogOptions logOptions)"
desc: "Sets the <xref uid=\"com.azure.core.http.policy.HttpLogOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"logging configuration\"></xref> to use when sending and receiving requests to and from the service. If a `logLevel` is not provided, default value of <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogDetailLevel#NONE\"></xref> is set.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.client.traits.HttpTrait.pipeline(com.azure.core.http.HttpPipeline)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.pipeline(HttpPipeline pipeline)"
name: "pipeline(HttpPipeline pipeline)"
nameWithType: "HttpTrait<T>.pipeline(HttpPipeline pipeline)"
summary: "Sets the <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> to use for the service client."
modifiers:
- "abstract"
parameters:
- description: "<xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> to use for sending service requests and receiving responses."
name: "pipeline"
type: "<xref href=\"com.azure.core.http.HttpPipeline?alt=com.azure.core.http.HttpPipeline&text=HttpPipeline\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T pipeline(HttpPipeline pipeline)"
desc: "Sets the <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> to use for the service client.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.client.traits.HttpTrait.retryOptions(com.azure.core.http.policy.RetryOptions)"
fullName: "com.azure.core.client.traits.HttpTrait<T>.retryOptions(RetryOptions retryOptions)"
name: "retryOptions(RetryOptions retryOptions)"
nameWithType: "HttpTrait<T>.retryOptions(RetryOptions retryOptions)"
summary: "Sets the <xref uid=\"com.azure.core.http.policy.RetryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RetryOptions\"></xref> for all the requests made through the client."
modifiers:
- "abstract"
parameters:
- description: "The <xref uid=\"com.azure.core.http.policy.RetryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RetryOptions\"></xref> to use for all the requests made through the client."
name: "retryOptions"
type: "<xref href=\"com.azure.core.http.policy.RetryOptions?alt=com.azure.core.http.policy.RetryOptions&text=RetryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract T retryOptions(RetryOptions retryOptions)"
desc: "Sets the <xref uid=\"com.azure.core.http.policy.RetryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RetryOptions\"></xref> for all the requests made through the client.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications."
returns:
description: "Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of\n operations."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
type: "interface"
typeParameters:
- description: "The concrete type that implements the trait. This is required so that fluent operations can continue\n to return the concrete type, rather than the trait type."
name: "T"
desc: "An <xref uid=\"com.azure.core.client.traits\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Azure SDK for Java trait\"></xref> providing a consistent interface for configuration of HTTP-specific settings. Refer to the Azure SDK for Java [HTTP clients and pipelines][] documentation for more details on proper usage and configuration of the Azure SDK for Java HTTP clients.\n\nIt is important to understand the precedence order of the HttpTrait APIs. In particular, if a <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.\n\n\n[HTTP clients and pipelines]: https://aka.ms/azsdk/java/docs/http-client-pipeline"
metadata: {}
package: "com.azure.core.client.traits"
artifact: com.azure:azure-core:1.54.0