Package com.auth0.net.client
Class DefaultHttpClient
java.lang.Object
com.auth0.net.client.DefaultHttpClient
- All Implemented Interfaces:
Auth0HttpClient
Default implementation of
Auth0HttpClient responsible for performing HTTP requests
to the Auth0 APIs. Instances can be configured and created using the DefaultHttpClient.Builder.
To minimize resource usage, instances should be created once and used in both the
ManagementAPI and AuthAPI
API clients.
For most use cases, usage of this client is recommended. If you have more advanced use cases,
such as the need to re-use an existing HTTP client, you may consider providing a custom
implementation of Auth0HttpClient.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultHttpClient.BuildersendRequest(Auth0HttpRequest request) Builds, executes, and returns the result of a synchronous HTTP request to an Auth0 API.sendRequestAsync(Auth0HttpRequest request) Builds and executes an asynchronous HTTP request to an Auth0 API.
-
Method Details
-
newBuilder
-
sendRequest
Description copied from interface:Auth0HttpClientBuilds, executes, and returns the result of a synchronous HTTP request to an Auth0 API.- Specified by:
sendRequestin interfaceAuth0HttpClient- Parameters:
request- the request to send.- Returns:
- the response returned by the executed request.
- Throws:
IOException- if the request can not be completed due to a network timeout or interruption.
-
sendRequestAsync
Description copied from interface:Auth0HttpClientBuilds and executes an asynchronous HTTP request to an Auth0 API.- Specified by:
sendRequestAsyncin interfaceAuth0HttpClient- Parameters:
request- the request to send.- Returns:
- the
CompletableFuturethat represents the result of the asynchronous HTTP request.
-