break;
case HEAD:
httpRequest = new HttpHead(uri);
break;
default:
throw new OpenESBClientException("Unknown HTTP method name: " + req.method());
}
if (req.headers() != null && !req.headers().isEmpty()) {
for (Map.Entry<String, String> header : req.headers().entrySet()) {
httpRequest.addHeader(header.getKey(), header.getValue());
}
}
if (authorizationToken != null) {
httpRequest.addHeader(HttpHeaders.AUTHORIZATION, "Token " + authorizationToken);
}
return httpClient.execute(host, httpRequest, responseHandler);
} catch (Exception ex) {
// Logger.getLogger(OpenESBClientImpl.class.getName()).log(Level.SEVERE, null, ex);
throw new OpenESBClientException(ex.getMessage(), ex);
}
}