azure-docs-sdk-java/docs-ref-autogen/com.azure.core.util.HttpCli...

319 строки
38 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.util.HttpClientOptions"
fullName: "com.azure.core.util.HttpClientOptions"
name: "HttpClientOptions"
nameWithType: "HttpClientOptions"
summary: "General configuration options for <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClients\"></xref>."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "<xref href=\"com.azure.core.util.ClientOptions?alt=com.azure.core.util.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.core.util.ClientOptions.getApplicationId()?alt=com.azure.core.util.ClientOptions.getApplicationId&text=getApplicationId\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.getHeaders()?alt=com.azure.core.util.ClientOptions.getHeaders&text=getHeaders\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.getMetricsOptions()?alt=com.azure.core.util.ClientOptions.getMetricsOptions&text=getMetricsOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.getTracingOptions()?alt=com.azure.core.util.ClientOptions.getTracingOptions&text=getTracingOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.setApplicationId(java.lang.String)?alt=com.azure.core.util.ClientOptions.setApplicationId&text=setApplicationId\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.setHeaders(java.lang.Iterable<com.azure.core.util.Header>)?alt=com.azure.core.util.ClientOptions.setHeaders&text=setHeaders\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.setMetricsOptions(com.azure.core.util.MetricsOptions)?alt=com.azure.core.util.ClientOptions.setMetricsOptions&text=setMetricsOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.util.ClientOptions.setTracingOptions(com.azure.core.util.TracingOptions)?alt=com.azure.core.util.ClientOptions.setTracingOptions&text=setTracingOptions\" data-throw-if-not-resolved=\"False\" />"
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **HttpClientOptions**</br> extends <xref href=\"com.azure.core.util.ClientOptions?alt=com.azure.core.util.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.azure.core.util.HttpClientOptions.HttpClientOptions()"
fullName: "com.azure.core.util.HttpClientOptions.HttpClientOptions()"
name: "HttpClientOptions()"
nameWithType: "HttpClientOptions.HttpClientOptions()"
summary: "Creates a new instance of <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref>."
syntax: "public HttpClientOptions()"
desc: "Creates a new instance of <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref>."
methods:
- uid: "com.azure.core.util.HttpClientOptions.getConfiguration()"
fullName: "com.azure.core.util.HttpClientOptions.getConfiguration()"
name: "getConfiguration()"
nameWithType: "HttpClientOptions.getConfiguration()"
summary: "Gets the configuration store that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
syntax: "public Configuration getConfiguration()"
desc: "Gets the configuration store that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
returns:
description: "The configuration store to use."
type: "<xref href=\"com.azure.core.util.Configuration?alt=com.azure.core.util.Configuration&text=Configuration\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.getConnectTimeout()"
fullName: "com.azure.core.util.HttpClientOptions.getConnectTimeout()"
name: "getConnectTimeout()"
nameWithType: "HttpClientOptions.getConnectTimeout()"
summary: "Gets the connection timeout for a request to be sent."
syntax: "public Duration getConnectTimeout()"
desc: "Gets the connection timeout for a request to be sent.\n\nThe connection timeout begins once the request attempts to connect to the remote host and finishes when the connection is resolved.\n\nIf `connectTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\"></xref> or a 10-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `connectTimeout` will be used.\n\nThe default connection timeout is 10 seconds."
returns:
description: "The connection timeout of a request to be sent."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.util.HttpClientOptions.getConnectionIdleTimeout()"
fullName: "com.azure.core.util.HttpClientOptions.getConnectionIdleTimeout()"
name: "getConnectionIdleTimeout()"
nameWithType: "HttpClientOptions.getConnectionIdleTimeout()"
summary: "Gets the duration of time before an idle connection is closed."
syntax: "public Duration getConnectionIdleTimeout()"
desc: "Gets the duration of time before an idle connection is closed.\n\nThe default connection idle timeout is 60 seconds."
returns:
description: "The connection idle timeout duration."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.util.HttpClientOptions.getHttpClientProvider()"
fullName: "com.azure.core.util.HttpClientOptions.getHttpClientProvider()"
name: "getHttpClientProvider()"
nameWithType: "HttpClientOptions.getHttpClientProvider()"
summary: "Gets type of the <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation that should be used to construct an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>."
syntax: "public Class<? extends HttpClientProvider> getHttpClientProvider()"
desc: "Gets type of the <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation that should be used to construct an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>."
returns:
description: "The <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation used to create an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"? extends com.azure.core.http.HttpClientProvider?alt=? extends com.azure.core.http.HttpClientProvider&text=HttpClientProvider\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.core.util.HttpClientOptions.getMaximumConnectionPoolSize()"
fullName: "com.azure.core.util.HttpClientOptions.getMaximumConnectionPoolSize()"
name: "getMaximumConnectionPoolSize()"
nameWithType: "HttpClientOptions.getMaximumConnectionPoolSize()"
summary: "Gets the maximum connection pool size used by the underlying HTTP client."
syntax: "public Integer getMaximumConnectionPoolSize()"
desc: "Gets the maximum connection pool size used by the underlying HTTP client.\n\nModifying the maximum connection pool size may have effects on the performance of an application. Increasing the maximum connection pool will result in more connections being available for an application but may result in more contention for network resources. It is recommended to perform performance analysis on different maximum connection pool sizes to find the right configuration for an application.\n\nThis maximum connection pool size is not a global configuration but an instance level configuration for each <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> created using this <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref>.\n\nThe default maximum connection pool size is determined by the underlying HTTP client. Setting the maximum connection pool size to null resets the configuration to use the default determined by the underlying HTTP client."
returns:
description: "The maximum connection pool size."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html\">Integer</a>"
- uid: "com.azure.core.util.HttpClientOptions.getProxyOptions()"
fullName: "com.azure.core.util.HttpClientOptions.getProxyOptions()"
name: "getProxyOptions()"
nameWithType: "HttpClientOptions.getProxyOptions()"
summary: "Gets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
syntax: "public ProxyOptions getProxyOptions()"
desc: "Gets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
returns:
description: "The proxy options to use."
type: "<xref href=\"com.azure.core.http.ProxyOptions?alt=com.azure.core.http.ProxyOptions&text=ProxyOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.getReadTimeout()"
fullName: "com.azure.core.util.HttpClientOptions.getReadTimeout()"
name: "getReadTimeout()"
nameWithType: "HttpClientOptions.getReadTimeout()"
summary: "Gets the read timeout duration used when reading the server response."
syntax: "public Duration getReadTimeout()"
desc: "Gets the read timeout duration used when reading the server response.\n\nThe default read timeout is 60 seconds."
returns:
description: "The read timeout duration."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.util.HttpClientOptions.getResponseTimeout()"
fullName: "com.azure.core.util.HttpClientOptions.getResponseTimeout()"
name: "getResponseTimeout()"
nameWithType: "HttpClientOptions.getResponseTimeout()"
summary: "Gets the response timeout duration used when waiting for a server to reply."
syntax: "public Duration getResponseTimeout()"
desc: "Gets the response timeout duration used when waiting for a server to reply.\n\nThe response timeout begins once the request write completes and finishes once the first response read is triggered when the server response is received.\n\nIf `responseTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied to the response. When applying the timeout the greatest of one millisecond and the value of `responseTimeout` will be used.\n\nThe default response timeout is 60 seconds."
returns:
description: "The response timeout duration."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.util.HttpClientOptions.getWriteTimeout()"
fullName: "com.azure.core.util.HttpClientOptions.getWriteTimeout()"
name: "getWriteTimeout()"
nameWithType: "HttpClientOptions.getWriteTimeout()"
summary: "Gets the writing timeout for a request to be sent."
syntax: "public Duration getWriteTimeout()"
desc: "Gets the writing timeout for a request to be sent.\n\nThe writing timeout does not apply to the entire request but to each emission being sent over the wire. For example a request body which emits `10` `8KB` buffers will trigger `10` write operations, the outbound buffer will be periodically checked to determine if it is still draining.\n\nIf `writeTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no write timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `writeTimeout` will be used.\n\nThe default writing timeout is 60 seconds."
returns:
description: "The writing timeout of a request to be sent."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.util.HttpClientOptions.readTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.readTimeout(Duration readTimeout)"
name: "readTimeout(Duration readTimeout)"
nameWithType: "HttpClientOptions.readTimeout(Duration readTimeout)"
summary: "Sets the read timeout duration used when reading the server response."
parameters:
- description: "Read timeout duration."
name: "readTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions readTimeout(Duration readTimeout)"
desc: "Sets the read timeout duration used when reading the server response.\n\nThe read timeout begins once the first response read is triggered after the server response is received. This timeout triggers periodically but won't fire its operation if another read operation has completed between when the timeout is triggered and completes.\n\nIf `readTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_READ_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_READ_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout period will be applied to response read. When applying the timeout the greatest of one millisecond and the value of `readTimeout` will be used.\n\nThe default read timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.responseTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.responseTimeout(Duration responseTimeout)"
name: "responseTimeout(Duration responseTimeout)"
nameWithType: "HttpClientOptions.responseTimeout(Duration responseTimeout)"
summary: "Sets the response timeout duration used when waiting for a server to reply."
parameters:
- description: "Response timeout duration."
name: "responseTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions responseTimeout(Duration responseTimeout)"
desc: "Sets the response timeout duration used when waiting for a server to reply.\n\nThe response timeout begins once the request write completes and finishes once the first response read is triggered when the server response is received.\n\nIf `responseTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied to the response. When applying the timeout the greatest of one millisecond and the value of `responseTimeout` will be used.\n\nThe default response timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setApplicationId(java.lang.String)"
fullName: "com.azure.core.util.HttpClientOptions.setApplicationId(String applicationId)"
name: "setApplicationId(String applicationId)"
nameWithType: "HttpClientOptions.setApplicationId(String applicationId)"
summary: "Sets the application ID."
overridden: "com.azure.core.util.ClientOptions.setApplicationId(java.lang.String)"
parameters:
- name: "applicationId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public HttpClientOptions setApplicationId(String applicationId)"
desc: "Sets the application ID.\n\nThe `applicationId` is used to configure <xref uid=\"com.azure.core.http.policy.UserAgentPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"UserAgentPolicy\"></xref> for telemetry/monitoring purposes.\n\nSee [Azure Core: Telemetry policy][Azure Core_ Telemetry policy] for additional information.\n\n**Code Samples**\n\nCreate ClientOptions with application ID 'myApplicationId'\n\n```java\nClientOptions clientOptions = new ClientOptions()\n .setApplicationId(\"myApplicationId\");\n```\n\n\n[Azure Core_ Telemetry policy]: https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy"
returns:
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setConfiguration(com.azure.core.util.Configuration)"
fullName: "com.azure.core.util.HttpClientOptions.setConfiguration(Configuration configuration)"
name: "setConfiguration(Configuration configuration)"
nameWithType: "HttpClientOptions.setConfiguration(Configuration configuration)"
summary: "Sets the configuration store that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
parameters:
- description: "The configuration store to use."
name: "configuration"
type: "<xref href=\"com.azure.core.util.Configuration?alt=com.azure.core.util.Configuration&text=Configuration\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpClientOptions setConfiguration(Configuration configuration)"
desc: "Sets the configuration store that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setConnectTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.setConnectTimeout(Duration connectTimeout)"
name: "setConnectTimeout(Duration connectTimeout)"
nameWithType: "HttpClientOptions.setConnectTimeout(Duration connectTimeout)"
summary: "Sets the connection timeout for a request to be sent."
parameters:
- description: "Connect timeout duration."
name: "connectTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions setConnectTimeout(Duration connectTimeout)"
desc: "Sets the connection timeout for a request to be sent.\n\nThe connection timeout begins once the request attempts to connect to the remote host and finishes when the connection is resolved.\n\nIf `connectTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\"></xref> or a 10-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `connectTimeout` will be used.\n\nThe default connection timeout is 10 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setConnectionIdleTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.setConnectionIdleTimeout(Duration connectionIdleTimeout)"
name: "setConnectionIdleTimeout(Duration connectionIdleTimeout)"
nameWithType: "HttpClientOptions.setConnectionIdleTimeout(Duration connectionIdleTimeout)"
summary: "Sets the duration of time before an idle connection."
parameters:
- description: "The connection idle timeout duration."
name: "connectionIdleTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions setConnectionIdleTimeout(Duration connectionIdleTimeout)"
desc: "Sets the duration of time before an idle connection.\n\nThe connection idle timeout begins once the connection has completed its last network request. Every time the connection is used the idle timeout will reset.\n\nIf `connectionIdleTimeout` is null a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout period will be applied. When applying the timeout the greatest of one millisecond and the value of `connectionIdleTimeout` will be used.\n\nThe default connection idle timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setHeaders(java.lang.Iterable<com.azure.core.util.Header>)"
fullName: "com.azure.core.util.HttpClientOptions.setHeaders(Iterable<Header> headers)"
name: "setHeaders(Iterable<Header> headers)"
nameWithType: "HttpClientOptions.setHeaders(Iterable<Header> headers)"
summary: "Sets the <xref uid=\"com.azure.core.util.Header\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Headers\"></xref>."
overridden: "com.azure.core.util.ClientOptions.setHeaders(java.lang.Iterable<com.azure.core.util.Header>)"
parameters:
- name: "headers"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.core.util.Header?alt=com.azure.core.util.Header&text=Header\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public HttpClientOptions setHeaders(Iterable<Header> headers)"
desc: "Sets the <xref uid=\"com.azure.core.util.Header\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Headers\"></xref>.\n\nThe passed headers are applied to each request sent with the client.\n\nThis overwrites all previously set headers.\n\n**Code Samples**\n\nCreate ClientOptions with Header 'myCustomHeader':'myStaticValue'\n\n```java\nClientOptions clientOptions = new ClientOptions()\n .setHeaders(Collections.singletonList(new Header(\"myCustomHeader\", \"myStaticValue\")));\n```"
returns:
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setHttpClientProvider(java.lang.Class<? extends com.azure.core.http.HttpClientProvider>)"
fullName: "com.azure.core.util.HttpClientOptions.setHttpClientProvider(Class<? extends HttpClientProvider> httpClientProvider)"
name: "setHttpClientProvider(Class<? extends HttpClientProvider> httpClientProvider)"
nameWithType: "HttpClientOptions.setHttpClientProvider(Class<? extends HttpClientProvider> httpClientProvider)"
summary: "Sets the type of the <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation that should be used to construct an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>."
parameters:
- description: "The <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation used to create an instance of\n <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>."
name: "httpClientProvider"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"? extends com.azure.core.http.HttpClientProvider?alt=? extends com.azure.core.http.HttpClientProvider&text=HttpClientProvider\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public HttpClientOptions setHttpClientProvider(Class<? extends HttpClientProvider> httpClientProvider)"
desc: "Sets the type of the <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> implementation that should be used to construct an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>. If the value isn't set or is an empty string the first <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> resolved by [ServiceLoader][] will be used to create an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>. If the value is set and doesn't match any <xref uid=\"? extends com.azure.core.http.HttpClientProvider\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientProvider\"></xref> resolved by [ServiceLoader][] an <xref uid=\"java.lang.IllegalStateException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"IllegalStateException\"></xref> will be thrown when attempting to create an instance of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref>.\n\n\n[ServiceLoader]: https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html"
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setMaximumConnectionPoolSize(java.lang.Integer)"
fullName: "com.azure.core.util.HttpClientOptions.setMaximumConnectionPoolSize(Integer maximumConnectionPoolSize)"
name: "setMaximumConnectionPoolSize(Integer maximumConnectionPoolSize)"
nameWithType: "HttpClientOptions.setMaximumConnectionPoolSize(Integer maximumConnectionPoolSize)"
summary: "Sets the maximum connection pool size used by the underlying HTTP client."
parameters:
- description: "The maximum connection pool size."
name: "maximumConnectionPoolSize"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html\">Integer</a>"
syntax: "public HttpClientOptions setMaximumConnectionPoolSize(Integer maximumConnectionPoolSize)"
desc: "Sets the maximum connection pool size used by the underlying HTTP client.\n\nModifying the maximum connection pool size may have effects on the performance of an application. Increasing the maximum connection pool will result in more connections being available for an application but may result in more contention for network resources. It is recommended to perform performance analysis on different maximum connection pool sizes to find the right configuration for an application.\n\nThis maximum connection pool size is not a global configuration but an instance level configuration for each <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> created using this <xref uid=\"com.azure.core.util.HttpClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClientOptions\"></xref>.\n\nThe default maximum connection pool size is determined by the underlying HTTP client. Setting the maximum connection pool size to null resets the configuration to use the default determined by the underlying HTTP client."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setProxyOptions(com.azure.core.http.ProxyOptions)"
fullName: "com.azure.core.util.HttpClientOptions.setProxyOptions(ProxyOptions proxyOptions)"
name: "setProxyOptions(ProxyOptions proxyOptions)"
nameWithType: "HttpClientOptions.setProxyOptions(ProxyOptions proxyOptions)"
summary: "Sets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
parameters:
- description: "The proxy options to use."
name: "proxyOptions"
type: "<xref href=\"com.azure.core.http.ProxyOptions?alt=com.azure.core.http.ProxyOptions&text=ProxyOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpClientOptions setProxyOptions(ProxyOptions proxyOptions)"
desc: "Sets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> will use."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setReadTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.setReadTimeout(Duration readTimeout)"
name: "setReadTimeout(Duration readTimeout)"
nameWithType: "HttpClientOptions.setReadTimeout(Duration readTimeout)"
summary: "Sets the read timeout duration used when reading the server response."
parameters:
- description: "Read timeout duration."
name: "readTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions setReadTimeout(Duration readTimeout)"
desc: "Sets the read timeout duration used when reading the server response.\n\nThe read timeout begins once the first response read is triggered after the server response is received. This timeout triggers periodically but won't fire its operation if another read operation has completed between when the timeout is triggered and completes.\n\nIf `readTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_READ_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_READ_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout period will be applied to response read. When applying the timeout the greatest of one millisecond and the value of `readTimeout` will be used.\n\nThe default read timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setResponseTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.setResponseTimeout(Duration responseTimeout)"
name: "setResponseTimeout(Duration responseTimeout)"
nameWithType: "HttpClientOptions.setResponseTimeout(Duration responseTimeout)"
summary: "Sets the response timeout duration used when waiting for a server to reply."
parameters:
- description: "Response timeout duration."
name: "responseTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions setResponseTimeout(Duration responseTimeout)"
desc: "Sets the response timeout duration used when waiting for a server to reply.\n\nThe response timeout begins once the request write completes and finishes once the first response read is triggered when the server response is received.\n\nIf `responseTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied to the response. When applying the timeout the greatest of one millisecond and the value of `responseTimeout` will be used.\n\nThe default response timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.HttpClientOptions.setWriteTimeout(java.time.Duration)"
fullName: "com.azure.core.util.HttpClientOptions.setWriteTimeout(Duration writeTimeout)"
name: "setWriteTimeout(Duration writeTimeout)"
nameWithType: "HttpClientOptions.setWriteTimeout(Duration writeTimeout)"
summary: "Sets the writing timeout for a request to be sent."
parameters:
- description: "Write operation timeout duration."
name: "writeTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public HttpClientOptions setWriteTimeout(Duration writeTimeout)"
desc: "Sets the writing timeout for a request to be sent.\n\nThe writing timeout does not apply to the entire request but to each emission being sent over the wire. For example a request body which emits `10` `8KB` buffers will trigger `10` write operations, the outbound buffer will be periodically checked to determine if it is still draining.\n\nIf `writeTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no write timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `writeTimeout` will be used.\n\nThe default writing timeout is 60 seconds."
returns:
description: "The updated HttpClientOptions object."
type: "<xref href=\"com.azure.core.util.HttpClientOptions?alt=com.azure.core.util.HttpClientOptions&text=HttpClientOptions\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "General configuration options for <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClients\"></xref>.\n\n<xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> implementations may not support all configuration options in this class."
metadata: {}
package: "com.azure.core.util"
artifact: com.azure:azure-core:1.54.0