src/main/java/com/rockagen/commons/http/HttpConn.java
public static String sendBody(UsernamePasswordCredentials upc,
                                  InputStream keystore, char[] password,
                                  HttpHost targetHost, String uri, HttpEntity entity,
                                  HttpHost proxyHost, String encoding, RequestMethod method, Header... headers)
            throws IOException {

        if (!uri.startsWith("/")) {
            uri = "/" + uri;
        }

        HttpEntityEnclosingRequestBase hm = getHttpEntityMethod(method, uri);
        if (headers != null && headers.length > 0) {
            hm.setHeaders(headers);
        }
        if (entity != null) {
            hm.setEntity(entity);
        }

        log.debug("url: {} method: {}", getURL(targetHost, uri), method);
        return execute(targetHost, proxyHost, hm, encoding, upc,
                keystore, password);

    }
public static String sendBody(UsernamePasswordCredentials upc,
                                  InputStream keystore, char[] password,
                                  HttpHost targetHost, String uri, HttpEntity entity,
                                  HttpHost proxyHost, String encoding, RequestMethod method, Header... headers)
            throws IOException {

        if (!uri.startsWith("/")) {
            uri = "/" + uri;
        }

        HttpEntityEnclosingRequestBase hm = getHttpEntityMethod(method, uri);
        if (headers != null && headers.length > 0) {
            hm.setHeaders(headers);
        }
        if (entity != null) {
            hm.setEntity(entity);
        }

        log.debug("url: {} method: {}", getURL(targetHost, uri), method);
        return execute(targetHost, proxyHost, hm, encoding, upc,
                keystore, password);

    }
public static String sendBody ( UsernamePasswordCredentials upc , InputStream keystore , char [ ] password , HttpHost targetHost , String uri , HttpEntity entity , HttpHost proxyHost , String encoding , RequestMethod method , Header ... headers ) throws IOException { if ( ! uri . startsWith ( "/" ) ) { uri = "/" + uri ; } HttpEntityEnclosingRequestBase hm = getHttpEntityMethod ( method , uri ) ; if ( headers != null && headers . length > 0 ) { hm . setHeaders ( headers ) ; } if ( entity != null ) { hm . setEntity ( entity ) ; } log . debug ( "url: {} method: {}" , getURL ( targetHost , uri ) , method ) ; return execute ( targetHost , proxyHost , hm , encoding , upc , keystore , password ) ; }
Send a http request with implicit params

@param upc        basic auth {@link UsernamePasswordCredentials}
@param keystore   keyStore InputStream
@param password   keyStore password
@param targetHost HttpHost
@param uri        URI
@param entity     request {@link HttpEntity}
@param proxyHost  HttpHost
@param encoding   (default UTF-8)
@param method     {@link com.rockagen.commons.http.RequestMethod}
@param headers headers
@return result String
@throws IOException  if an I/O error occurs
Send a http request with implicit params