if (request.getMethod().equals(HttpMethod.HEAD)) {
apacheRequest = new HttpHead(request.getEndpoint());
} else if (request.getMethod().equals(HttpMethod.GET)) {
apacheRequest = new HttpGet(request.getEndpoint());
} else if (request.getMethod().equals(HttpMethod.DELETE)) {
apacheRequest = new HttpDelete(request.getEndpoint());
} else if (request.getMethod().equals(HttpMethod.PUT)) {
apacheRequest = new HttpPut(request.getEndpoint());
apacheRequest.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
} else if (request.getMethod().equals(HttpMethod.POST)) {
apacheRequest = new HttpPost(request.getEndpoint());