Package com.softlayer.api.http
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
getBodyStream()
Stream to write body contents to (if at all).Future<HttpResponse>
invokeAsync(Callable<?> setupBody)
Make asynchronous HTTP invocation.Future<?>
invokeAsync(Callable<?> setupBody, ResponseHandler<HttpResponse> callback)
Callback-form ofinvokeAsync(Callable)
HttpResponse
invokeSync(Callable<?> setupBody)
Make synchronous HTTP invocation.
-
-
-
Method Detail
-
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 ofinvokeAsync(Callable)
-
-