Interface HttpClientContext

All Superinterfaces:
HttpClient

@Deprecated public interface HttpClientContext extends HttpClient
Deprecated.
Deprecated in favor of HttpClient. Migrate to using HttpClient.builder().

The HTTP client context that we use to build and process requests.



   HttpClientContext ctx = HttpClientContext.builder()
       .baseUrl("http://localhost:8080")
       .bodyAdapter(new JacksonBodyAdapter())
       .build();

  HelloDto dto = ctx.request()
       .path("hello")
       .queryParam("name", "Rob")
       .queryParam("say", "Whats up")
       .GET()
       .bean(HelloDto.class);

 
  • Method Details

    • builder

      Deprecated.
      Deprecated - migrate to HttpClient.builder().

      Return the builder to config and build the client context.

      
      
         HttpClientContext ctx = HttpClientContext.builder()
             .baseUrl("http://localhost:8080")
             .bodyAdapter(new JacksonBodyAdapter())
             .build();
      
        HttpResponse<String> res = ctx.request()
             .path("hello")
             .GET().asString();
      
       
    • newBuilder

      Deprecated.
      Deprecated - migrate to builder().