}
}
HttpResponse forward() throws Exception {
RequestContext context = RequestContext.getCurrentContext();
HttpRequest.Builder builder = HttpRequest.newBuilder().
verb(verb).
uri(uri).
entity(requestEntity);
for (String name : headers.keySet()) {
List<String> values = headers.get(name);
for (String value : values) {
builder.header(name, value);
}
}
for (String name : params.keySet()) {
List<String> values = params.get(name);
for (String value : values) {
builder.queryParams(name, value);
}
}
HttpRequest httpClientRequest = builder.build();
HttpResponse response = restClient.executeWithLoadBalancer(httpClientRequest);
context.set("ribbonResponse", response);
return response;
}