return PathUtil.concat(baseUrl, serviceUrl, '/');
}
private void xhr(HttpServletRequest request, HttpServletResponse response, String serviceUrl, Map<String, String[]> parameters, Map<String, String> headers, Content content, Handler format)
throws ClientServicesException, ClientProtocolException, IOException, ServletException, URISyntaxException {
Args args = new Args();
args.setServiceUrl(serviceUrl);
args.setHandler(format);
args.setHeaders(headers);
String smethod = request.getMethod();
HttpRequestBase method = createMethod(smethod, new URI(composeRequestUrl(args, parameters)), request);
DefaultHttpClient defaultHttpClient = new DefaultHttpClient();
if (endpoint.isForceTrustSSLCertificate()) {
defaultHttpClient = SSLUtil.wrapHttpClient(defaultHttpClient);
}
if (endpoint.isForceDisableExpectedContinue()) {
defaultHttpClient.getParams().setParameter(
CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
}
endpoint.initialize(defaultHttpClient);
for (Map.Entry<String, String> e : args.getHeaders().entrySet()) {
String headerName = e.getKey();
String headerValue = e.getValue();
method.addHeader(headerName, headerValue);
}
if (content != null) {