use of com.amazonaws.http.ExecutionContext in project sandbox by irof.
the class AmazonHttpClientTest method sendRequest.
private void sendRequest(Supplier<AmazonHttpClient> client) {
Request<?> request = new DefaultRequest<>("test-service");
request.setEndpoint(server.getUri());
InputStream in = new ByteArrayInputStream("hoge".getBytes(StandardCharsets.UTF_8));
request.setContent(in);
client.get().execute(request, new HttpResponseHandler<AmazonWebServiceResponse<Object>>() {
@Override
public AmazonWebServiceResponse<Object> handle(HttpResponse response) throws Exception {
return new AmazonWebServiceResponse<>();
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
}, new HttpResponseHandler<AmazonServiceException>() {
@Override
public AmazonServiceException handle(HttpResponse response) throws Exception {
return null;
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
}, new ExecutionContext());
}
Aggregations