Class HttpApiClient

java.lang.Object
com.google.genai.HttpApiClient

@InternalApi public class HttpApiClient extends Object
Base client for the HTTP APIs. This is for internal use only.
  • Method Details

    • request

      public com.google.genai.HttpApiResponse request(String httpMethod, String path, String requestJson, Optional<HttpOptions> requestHttpOptions)
      Sends a Http request given the http method, path, request json string, and http options. Request bodies included for non-POST/PUT/PATCH methods will be ignored.
    • request

      public com.google.genai.HttpApiResponse request(String httpMethod, String url, byte[] requestBytes, Optional<HttpOptions> requestHttpOptions)
      Sends a Http request given the http method, path, request bytes, and http options.
    • asyncRequest

      public CompletableFuture<com.google.genai.ApiResponse> asyncRequest(String httpMethod, String path, String requestJson, Optional<HttpOptions> requestHttpOptions)
      Sends an asynchronous Http request given the http method, path, request json string, and http options.
    • asyncRequest

      public CompletableFuture<com.google.genai.ApiResponse> asyncRequest(String httpMethod, String url, byte[] requestBytes, Optional<HttpOptions> requestHttpOptions)
      Sends an asynchronous Http request given the http method, path, request bytes, and http options.
    • vertexAI

      public boolean vertexAI()
      Returns whether the client is using Vertex AI APIs.
    • project

      public @Nullable String project()
      Returns the project ID for Vertex AI APIs.
    • location

      public @Nullable String location()
      Returns the location for Vertex AI APIs.
    • apiKey

      public @Nullable String apiKey()
      Returns the API key for Google AI APIs.