Class DefaultAsyncOverReactiveHttpClient
java.lang.Object
io.micronaut.http.client.DefaultAsyncOverReactiveHttpClient
- All Implemented Interfaces:
io.micronaut.context.LifeCycle<AsyncHttpClient>, AsyncHttpClient, Closeable, AutoCloseable
Default
AsyncHttpClient implementation that adapts a reactive HttpClient.- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<I,O, E> CompletionStage <io.micronaut.http.HttpResponse<O>> exchange(io.micronaut.http.HttpRequest<I> request, @Nullable io.micronaut.core.type.Argument<O> bodyType, io.micronaut.core.type.Argument<E> errorType) Perform an HTTP request for the given request object emitting the full HTTP response and converting the response body to the specified type.protected final HttpClientbooleanstart()stop()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncHttpClient
exchange, exchange, exchange, exchange, exchange, retrieve, retrieve, retrieve, retrieve, retrieveMethods inherited from interface io.micronaut.context.LifeCycle
refresh
-
Constructor Details
-
DefaultAsyncOverReactiveHttpClient
- Parameters:
httpClient- The delegate client
-
-
Method Details
-
exchange
public <I,O, CompletionStage<io.micronaut.http.HttpResponse<O>> exchangeE> (io.micronaut.http.HttpRequest<I> request, @Nullable io.micronaut.core.type.Argument<O> bodyType, io.micronaut.core.type.Argument<E> errorType) Description copied from interface:AsyncHttpClientPerform an HTTP request for the given request object emitting the full HTTP response and converting the response body to the specified type.- Specified by:
exchangein interfaceAsyncHttpClient- Type Parameters:
I- The request body typeO- The response body typeE- The error type- Parameters:
request- TheHttpRequestto executebodyType- The body typeerrorType- The error type- Returns:
- A
CompletionStagethat completes with the fullHttpResponse
-
start
- Specified by:
startin interfaceio.micronaut.context.LifeCycle<AsyncHttpClient>
-
stop
- Specified by:
stopin interfaceio.micronaut.context.LifeCycle<AsyncHttpClient>
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceio.micronaut.context.LifeCycle<AsyncHttpClient>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceio.micronaut.context.LifeCycle<AsyncHttpClient>
-
getHttpClient
- Returns:
- The underlying
HttpClient
-