Package io.micronaut.http.client
Interface HttpClientFactory
- All Known Implementing Classes:
AbstractHttpClientFactory
,JdkHttpClientFactory
,NettyHttpClientFactory
public interface HttpClientFactory
A factory to create HTTP clients.
- Since:
- 3.0.0
- Author:
- James Kleeh, Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptioncreateClient
(@Nullable URL url) Create a newHttpClient
.createClient
(@Nullable URL url, @NonNull HttpClientConfiguration configuration) Create a newHttpClient
with the specified configuration.
-
Method Details
-
createClient
Create a newHttpClient
. Note that this method should only be used outside the context of an application. Within Micronaut useInject
to inject a client instead- Parameters:
url
- The base URL- Returns:
- The client
-
createClient
@NonNull @NonNull HttpClient createClient(@Nullable @Nullable URL url, @NonNull @NonNull HttpClientConfiguration configuration) Create a newHttpClient
with the specified configuration. Note that this method should only be used outside the context of an application. Within Micronaut useInject
to inject a client instead- Parameters:
url
- The base URLconfiguration
- the client configuration- Returns:
- The client
- Since:
- 2.2.0
-