Interface HTTPClient

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.net.http.HttpResponse<java.io.InputStream> send​(java.net.http.HttpRequest request)
      Sends an HTTP request and returns the response.
    • Method Detail

      • send

        java.net.http.HttpResponse<java.io.InputStream> send​(java.net.http.HttpRequest request)
                                                      throws java.io.IOException,
                                                             java.lang.InterruptedException,
                                                             java.net.URISyntaxException
        Sends an HTTP request and returns the response.

        Note that HttpRequest is immutable. To modify the request you can use HttpRequest#newBuilder(HttpRequest, BiPredicate) with JDK 16 and later (which will copy the request for modification in a builder). If that method is not available then use Helpers.copy(java.net.http.HttpRequest) (which also returns a builder).

        Parameters:
        request - HTTP request
        Returns:
        HTTP response
        Throws:
        java.io.IOException
        java.lang.InterruptedException
        java.net.URISyntaxException