Module io.avaje.http.client
Package io.avaje.http.client
package io.avaje.http.client
Provides a HTTP client with support for adapting body content
(like JSON) to java types.
Uses the Java http client
HttpClient client = HttpClient.builder()
.baseUrl("http://localhost:8080")
.bodyAdapter(new JacksonBodyAdapter())
.build();
HelloDto dto = client.request()
.path("hello")
.queryParam("say", "Whats up")
.GET()
.bean(HelloDto.class);
-
ClassDescriptionRepresents an Authorization Bearer token that can be held on the context.Standard AuthToken implementation.Use to obtain an Authorization bearer token that is expected to be used.Adds Basic Authorization header to requests.Adaptor between beans and content of a request or response.Content of request or response body used for adapting to beans.BodyReader<T>Read content as a java type.BodyWriter<T>Writes beans as content for a specific content type.Provides http client implementations for an interface.Async processing of the request with responses as CompletableFuture.HttpCall<E>Allows for executing the request asynchronously or synchronously.Allows the client code to choose to execute the request asynchronously or synchronously.The HTTP client context that we use to build and process requests.Builds the HttpClient.The state of the builder with methods to read the set state.Components register Generated Client interface ProvidersStatistic metrics collected to provide an overview of activity of this client.Http request that is built and sent to the server.Controls how the response is processed including potential conversion into beans.HTTP Exception with support for converting the error response body into a bean.Jackson BodyAdapter to read and write beans as JSON.Avaje Jsonb BodyAdapter to read and write beans as JSON.Helper methods to convert common types to String path values.Interceptor for before the request is made and after the response is obtained.Listen to responses.The response event details.Logs request and response details for debug logging purposes using
System.Logger
.Define how retry should occur on a request.Simple retry with max attempts and linear backoff.Build a URL typically using a base url and adding path and query parameters.