Skip to content

Custom HTTP Clients

Alan Zimmer edited this page Feb 27, 2020 · 5 revisions

Introduction

Azure SDKs for Java offers the capability to plug-in your own custom networking layer to allow for handling of specialized scenarios or when you don't want to use Netty or OkHttp. Providing a custom HttpClient requires a few interfaces/classes to be implemented along with registering your implementation with Java's service provider interface.

Required Implementation Classes

The following is what needs to be implemented.

  • HttpClient handles sending request and receiving responses.
  • HttpResponse contains response information and APIs to interact with it.
  • HttpClientProvider handles creating instances of the HttpClient agnostic to the underlying implementation.

Implementation Details

Azure Core Target Version

Registering with Java's Service Provider Interface (SPI)

Example

Clone this wiki locally