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



   HttpClientContext ctx = HttpClientContext.newBuilder()
       .withBaseUrl("http://localhost:8080")
       .withBodyAdapter(new JacksonBodyAdapter(new ObjectMapper()))
       .build();

  HelloDto dto = ctx.request()
       .path("hello")
       .queryParam("say", "Ki ora")
       .get()
       .bean(HelloDto.class);

 
  • Interface Summary
    Interface
    Description
    Represents an Authorization Bearer token that can be held on the context.
    Use to obtain an Authorization bearer token that is expected to be used.
    Adaptor between beans and content of a request or response.
    Read content as a java type.
    Writes beans as content for a specific content type.
    Provides Http client service implementations for a given interface type.
    Provides http client implementations for an interface.
    The HTTP client context that we use to build and process requests.
    Builds the HttpClientContext.
    Http request that is built and sent to the server.
    Controls how the response is processed including potential conversion into beans.
    Interceptor for before the request is made and after the response is obtained.
    Listen to responses.
    The response event details.
  • Class Summary
    Class
    Description
    Standard AuthToken implementation.
    Content of request or response body used for adapting to beans.
    Jackson BodyAdapter to read and write beans as JSON.
    Helper methods to convert common types to String path values.
    Logs request and response details for debug logging purposes.
    Build a URL typically using a base url and adding path and query parameters.
  • Exception Summary
    Exception
    Description
    HTTP Exception with support for converting the error response body into a bean.