congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpClient.version
Code IndexAdd Tabnine to your IDE (free)

How to use
version
method
in
java.net.http.HttpClient

Best Java code snippets using java.net.http.HttpClient.version (Showing top 3 results out of 315)

origin: com.playtika.reactivefeign/feign-reactor-java11

public Java11ReactiveHttpClientFactory(
    HttpClient httpClient, JsonFactory jsonFactory, ObjectMapper objectMapper,
    Java11ReactiveOptions options) {
  this.httpClient = httpClient;
  this.jsonFactory = jsonFactory;
  this.objectMapper = objectMapper;
  this.options = options;
  if(useHttp2(options) && HttpClient.Version.HTTP_2 != httpClient.version()){
    throw new IllegalArgumentException("Set correct version to httpClient");
  }
}
origin: com.playtika.reactivefeign/feign-reactor-java11

@Override
public void target(Target target) {
  if(httpClient.version() == HttpClient.Version.HTTP_2){
    //preliminary upgrade to h2s and setup TCP connection
    upgradeToH2c(target);
  }
}
origin: com.playtika.reactivefeign/feign-reactor-java11

@Override
public Mono<ReactiveHttpResponse> executeRequest(ReactiveHttpRequest request) {
  HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(request.uri())
      .method(request.method().toUpperCase(), provideBody(request));
  setUpHeaders(request, requestBuilder);
  if(requestTimeout > 0){
    requestBuilder = requestBuilder.timeout(Duration.ofMillis(requestTimeout));
  }
  if(tryUseCompression){
    requestBuilder = requestBuilder.setHeader(ACCEPT_ENCODING_HEADER, GZIP);
  }
  Java11ReactiveHttpResponse.ReactiveBodySubscriber bodySubscriber = new Java11ReactiveHttpResponse.ReactiveBodySubscriber();
  CompletableFuture<HttpResponse<Void>> response = httpClient.sendAsync(
      requestBuilder.build(), fromSubscriber(bodySubscriber));
  return Mono.fromFuture(response)
      .<ReactiveHttpResponse>map(resp -> {
        if(!resp.version().equals(httpClient.version())){
          throw new IllegalArgumentException("Incorrect response version:"+resp.version());
        }
        return new Java11ReactiveHttpResponse(resp, bodySubscriber.content(),
            returnPublisherClass, returnActualClass,
            jsonFactory, responseReader);
      })
      .onErrorMap(ex -> ex instanceof CompletionException
               && ex.getCause() instanceof java.net.http.HttpTimeoutException,
          ReadTimeoutException::new);
}
java.net.httpHttpClientversion

Popular methods of HttpClient

  • newBuilder
  • send
  • sendAsync

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now