Class HttpRequest

java.lang.Object
com.google.genai.gaos.utils.transport.HttpRequest

public final class HttpRequest extends Object
An immutable HTTP request that is independent of the underlying HTTP client. Use builder() to create a request and toBuilder() to copy an existing request for modification (for example in a hook).
  • Method Details

    • method

      public String method()
      Returns the HTTP method (uppercase, for example GET).
    • uri

      public URI uri()
    • headers

      public Headers headers()
      Returns a copy of the request headers. Header names are case-insensitive. Mutating the returned Headers does not affect this request; use toBuilder() to derive a modified request.
    • body

      public Optional<HttpBody> body()
    • builder

      public static HttpRequest.Builder builder()
    • toBuilder

      public HttpRequest.Builder toBuilder()
      Returns a new builder initialized with a copy of this request.
    • toString

      public String toString()
      Overrides:
      toString in class Object