HttpRequestBase entityRequest = setupHttpRequest(request, client, entityWriter);
try {
return client.execute(entityRequest);
} catch (Exception ex) {
entityRequest.abort();
throw new RuntimeException(ex);
}
}
private HttpRequestBase setupHttpRequest(ClientRequest request,