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 used for authenticated requests.Adds Basic Authorization header to requests.Adds a Bearer authentication Authorization header to requests.Adapter between beans and content of a request or response.Content of request or response body.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.Use to set the body content using a callback that writes to an
OutputStream.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 usingSystem.Logger.Define how retry should occur on a request.Simple retry with max attempts and linear backoff.A BodyAdapter that supports converting the request/response body to a single type.Json body reading and writing for a single type.Build a URL typically using a base url and adding path and query parameters.