Provides a HTTP client with support for adapting body content (like JSON) to java types.
Uses the Java http client
HttpClientContext ctx = HttpClientContext.newBuilder() .baseUrl("http://localhost:8080") .bodyAdapter(new JacksonBodyAdapter()) .build(); HelloDto dto = ctx.request() .path("hello") .queryParam("say", "Whats up") .GET() .bean(HelloDto.class);
Interface Summary Interface Description AuthTokenRepresents an Authorization Bearer token that can be held on the context. AuthTokenProviderUse to obtain an Authorization bearer token that is expected to be used. BodyAdapterAdaptor between beans and content of a request or response. BodyReader<T>Read content as a java type. BodyWriter<T>Writes beans as content for a specific content type. HttpApiProvider<T>Provides http client implementations for an interface. HttpAsyncResponseAsync processing of the request with responses as CompletableFuture. HttpCall<E>Allows for executing the request asynchronously or synchronously. HttpCallResponseAllows the client code to choose to execute the request asynchronously or synchronously. HttpClientContextThe HTTP client context that we use to build and process requests. HttpClientContext.BuilderBuilds the HttpClientContext. HttpClientRequestHttp request that is built and sent to the server. HttpClientResponseControls how the response is processed including potential conversion into beans. RequestInterceptInterceptor for before the request is made and after the response is obtained. RequestListenerListen to responses. RequestListener.EventThe response event details. RetryHandlerDefine how retry should occur on a request.
Class Summary Class Description AuthToken.BasicStandard AuthToken implementation. BasicAuthInterceptAdds Basic Authorization header to requests. BodyContentContent of request or response body used for adapting to beans. JacksonBodyAdapterJackson BodyAdapter to read and write beans as JSON. JsonbBodyAdapteravaje jsonb BodyAdapter to read and write beans as JSON. PathConversionHelper methods to convert common types to String path values. RequestLoggerLogs request and response details for debug logging purposes. SimpleRetryHandlerSimple retry with max attempts and linear backoff. UrlBuilderBuild a URL typically using a base url and adding path and query parameters.
Exception Summary Exception Description HttpExceptionHTTP Exception with support for converting the error response body into a bean.