Class HttpClient

java.lang.Object
ai.fal.client.http.HttpClient

public class HttpClient extends Object
  • Constructor Details

    • HttpClient

      public HttpClient(@Nonnull ClientConfig config, @Nonnull okhttp3.OkHttpClient client)
  • Method Details

    • prepareRequest

      @Nonnull public okhttp3.Request prepareRequest(@Nonnull String url, @Nonnull ApiOptions options)
    • prepareRequest

      @Nonnull public okhttp3.Request prepareRequest(@Nonnull String url, @Nonnull ApiOptions options, @Nonnull Map<String,Object> queryParams)
    • executeRequest

      public okhttp3.Response executeRequest(okhttp3.Request request)
    • executeRequestAsync

      public CompletableFuture<okhttp3.Response> executeRequestAsync(okhttp3.Request request)
    • handleResponse

      public <T> T handleResponse(okhttp3.Response response, Class<T> resultType)
    • responseToException

      public FalException responseToException(okhttp3.Response response)
    • wrapInResult

      public <T> Output<T> wrapInResult(okhttp3.Response response, Class<T> resultType)
    • fromJson

      public <T> T fromJson(com.google.gson.JsonElement json, Class<T> type)
    • fromJson

      public <T> T fromJson(String json, Class<T> type)
    • getUnderlyingClient

      public okhttp3.OkHttpClient getUnderlyingClient()