# Class HttpApiClient

java.lang.Object
com.google.adk.sessions.HttpApiClient

public class HttpApiClient extends Object
Base client for the HTTP APIs.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final okhttp3.MediaType`
  `MEDIA_TYPE_APPLICATION_JSON`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `@Nullable String`
  `apiKey()`
  Returns the API key for Google AI APIs.
  `@Nullable String`
  `location()`
  Returns the location for Vertex AI APIs.
  `@Nullable String`
  `project()`
  Returns the project ID for Vertex AI APIs.
  `ApiResponse`
  `request(String httpMethod, String path, String requestJson)`
  Sends a Http request given the http method, path, and request json string.
  `boolean`
  `vertexAI()`
  Returns whether the client is using Vertex AI APIs.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MEDIA_TYPE_APPLICATION_JSON

    public static final okhttp3.MediaType MEDIA_TYPE_APPLICATION_JSON

- ## Method Details

  - ### request

    public ApiResponse request(String httpMethod, String path, String requestJson)
    Sends a Http request given the http method, path, and request json string.

  - ### 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.