Package io.micronaut.http.client
Interface HttpClientFactory
-
public interface HttpClientFactoryA factory to create HTTP clients.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpClientcreateClient(java.net.URL url)Create a newHttpClient.HttpClientcreateClient(java.net.URL url, HttpClientConfiguration configuration)Create a newHttpClientwith the specified configuration.
-
-
-
Method Detail
-
createClient
@NonNull HttpClient createClient(@Nullable java.net.URL url)
Create a newHttpClient. Note that this method should only be used outside of the context of an application. Within Micronaut useInjectto inject a client instead- Parameters:
url- The base URL- Returns:
- The client
-
createClient
@NonNull HttpClient createClient(@Nullable java.net.URL url, @NonNull HttpClientConfiguration configuration)
Create a newHttpClientwith the specified configuration. Note that this method should only be used outside of the context of an application. Within Micronaut useInjectto inject a client instead- Parameters:
url- The base URLconfiguration- the client configuration- Returns:
- The client
- Since:
- 2.2.0
-
-