Add method to java.net.http.HttpRequest to return a GET request in one call

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      We could avoid the following kind of common builder boilerplate

      HttpRequest request = HttpRequest.newBuilder()
         .uri(URI.create("https://foo.com/index.html"))
         .GET()
         .build();

      by adding a method to HttpRequest as follows:

          /***
           * Returns a GET HttpRequest to the given URI.
           *
           * @throws URISyntaxException if the string cannot be converted to a URI
          */
          public static HttpRequest GET(String uri) {}

            Assignee:
            Michael McMahon
            Reporter:
            Michael McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: