use of com.facebook.airlift.http.client.BodyGenerator in project presto by prestodb.
the class ResourceManagerProxy method performRequest.
public void performRequest(HttpServletRequest servletRequest, AsyncResponse asyncResponse, URI remoteUri) {
try {
BodyGenerator bodyGenerator = new InputStreamBodyGenerator(servletRequest.getInputStream());
Request request = createRequest(servletRequest, servletRequest.getMethod(), remoteUri, bodyGenerator);
ListenableFuture<ProxyResponse> proxyResponse = httpClient.executeAsync(request, new ResponseHandler());
ListenableFuture<Response> future = transform(proxyResponse, this::toResponse, executor);
setupAsyncResponse(servletRequest, asyncResponse, future);
} catch (IOException e) {
asyncResponse.resume(e);
}
}
Aggregations