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
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 Details
-
getBodyStream
OutputStream getBodyStream()Stream to write body contents to (if at all). When called, callers are expected to close it. -
invokeSync
Make synchronous HTTP invocation. Throws if unable to connect. Errors from the API are returned normally. -
invokeAsync
Make asynchronous HTTP invocation. All errors (inability to connect or API errors) are in the future. -
invokeAsync
Callback-form ofinvokeAsync(Callable)
-