Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8240921

Minor correction to HttpResponse.BodySubscribers example

XMLWordPrintable

    • b16
    • Not verified

      A DESCRIPTION OF THE PROBLEM :
      The first example of usage of the class java.net.http.HttpResponse.BodySubscribers states: "// Streams the response body to a File" but the subsequent code does instead accumulate the response body as a byte array.
      Expected something like:
      HttpResponse<Path> response =client.send(request, responseInfo -> BodySubscribers.ofFile(path));


            ryadav Rahul Yadav
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: