Class Request


  • public final class Request
    extends Object
    An HTTP Request.

    This interface provides a generic API for building and interacting with HTTP requests.

    • Method Detail

      • method

        public String method()
        The HTTP method.
        Returns:
        the HTTP method
      • uri

        public URI uri()
        The HTTP URI.
        Returns:
        the HTTP URI
      • headers

        public Headers headers()
        The HTTP headers for this request.
        Returns:
        the HTTP headers
      • timeout

        public Optional<Duration> timeout()
        The timeout for this request.
        Returns:
        the timeout for this request, if present
      • newBuilder

        public static Request.Builder newBuilder​(URI uri)
        Creates a Request builder with the given URI.
        Parameters:
        uri - the request URI
        Returns:
        the builder