Interface HttpClient

All Superinterfaces:
AutoCloseable, Closeable

public interface HttpClient
extends Closeable
This class is not thread-safe even when using invoke async. This class will only live for the duration of one HTTP request.
  • Method Details

    • getBodyStream

      OutputStream getBodyStream()
      Stream to write body contents to (if at all). When called, callers are expected to close it.
    • invokeSync

      HttpResponse invokeSync​(Callable<?> setupBody)
      Make synchronous HTTP invocation. Throws if unable to connect. Errors from the API are returned normally.
    • invokeAsync

      Future<HttpResponse> invokeAsync​(Callable<?> setupBody)
      Make asynchronous HTTP invocation. All errors (inability to connect or API errors) are in the future.
    • invokeAsync

      Future<?> invokeAsync​(Callable<?> setupBody, ResponseHandler<HttpResponse> callback)
      Callback-form of invokeAsync(Callable)