Azure Core OkHttp HTTP client is a plugin for the azure-core
HTTP client API.
- Java Development Kit (JDK) with version 8 or above
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId>
<version>1.2.5</version>
</dependency>
The following sections provide several code snippets covering some of the most common client configuration scenarios.
Create an OkHttp client using a connection timeout of 60 seconds and a read timeout of 120 seconds.
HttpClient client = new OkHttpAsyncHttpClientBuilder().build();
Create an OkHttp client that is using a proxy.
HttpClient client = new OkHttpAsyncHttpClientBuilder()
.proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<proxy-host>", 8888)))
.build();
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the logging wiki for guidance about enabling logging.
If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request