Class Request

java.lang.Object
com.inrupt.client.Request

public final class Request extends Object
An HTTP Request.

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

  • Method Details

    • method

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

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

      public Optional<Request.BodyPublisher> bodyPublisher()
      The Request.BodyPublisher set on this request.
      Returns:
      the body publisher, if present
    • 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()
      Creates a Request builder.
      Returns:
      the builder
    • newBuilder

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