Class JdkHttpClientFactory
java.lang.Object
io.micronaut.http.client.AbstractHttpClientFactory<DefaultJdkHttpClient>
io.micronaut.http.client.jdk.JdkHttpClientFactory
- All Implemented Interfaces:
HttpClientFactory, RawHttpClientFactory
@Internal
public class JdkHttpClientFactory
extends AbstractHttpClientFactory<DefaultJdkHttpClient>
implements RawHttpClientFactory
Factory to create java.net.http.* HTTP Clients.
- Since:
- 4.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from class AbstractHttpClientFactory
conversionService, mediaTypeCodecRegistry, messageBodyHandlerRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageBodyHandlerRegistryprotected DefaultJdkHttpClientcreateHttpClient(@Nullable URI uri) Creates a newHttpClientinstance for a given URI.protected DefaultJdkHttpClientcreateHttpClient(@Nullable URI uri, HttpClientConfiguration configuration) Creates a newHttpClientinstance for a given URI and configuration.createRawClient(@Nullable URI url, HttpClientConfiguration configuration) Create a newRawHttpClientwith the specified configuration.Methods inherited from class AbstractHttpClientFactory
createClient, createClientMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RawHttpClientFactory
createRawClient
-
Constructor Details
-
JdkHttpClientFactory
public JdkHttpClientFactory()
-
-
Method Details
-
createHttpClient
Description copied from class:AbstractHttpClientFactoryCreates a newHttpClientinstance for a given URI.- Specified by:
createHttpClientin classAbstractHttpClientFactory<DefaultJdkHttpClient>- Parameters:
uri- The URI- Returns:
- The client
-
createHttpClient
protected DefaultJdkHttpClient createHttpClient(@Nullable URI uri, HttpClientConfiguration configuration) Description copied from class:AbstractHttpClientFactoryCreates a newHttpClientinstance for a given URI and configuration.- Specified by:
createHttpClientin classAbstractHttpClientFactory<DefaultJdkHttpClient>- Parameters:
uri- The URIconfiguration- The configuration- Returns:
- The client
-
createDefaultMessageBodyHandlerRegistry
-
createRawClient
Description copied from interface:RawHttpClientFactoryCreate a newRawHttpClientwith the specified configuration. Note that this method should only be used outside the context of an application. Within Micronaut useInjectto inject a client instead- Specified by:
createRawClientin interfaceRawHttpClientFactory- Parameters:
url- The base URLconfiguration- the client configuration- Returns:
- The client
-