src/main/java/com/rockagen/commons/http/HttpConn.java
private static HttpRequestBase getHttpMethod(RequestMethod method, String uri) {
        HttpRequestBase hm;
        if (method != null) {
            switch (method) {
                case POST:
                    hm = new HttpPost(uri);
                    break;
                case GET:
                    hm = new HttpGet(uri);
                    break;
                case PUT:
                    hm = new HttpPut(uri);
                    break;
                case DELETE:
                    hm = new HttpDelete(uri);
                    break;
                case HEAD:
                    hm = new HttpHead(uri);
                    break;
                case OPTIONS:
                    hm = new HttpOptions(uri);
                    break;
                case TRACE:
                    hm = new HttpTrace(uri);
                    break;
                case PATCH:
                    hm = new HttpPatch(uri);
                    break;
                default:
                    hm = new HttpGet(uri);
                    break;
            }
        } else hm = new HttpGet(uri);
        return hm;
    }
private static HttpRequestBase getHttpMethod(RequestMethod method, String uri) {
        HttpRequestBase hm;
        if (method != null) {
            switch (method) {
                case POST:
                    hm = new HttpPost(uri);
                    break;
                case GET:
                    hm = new HttpGet(uri);
                    break;
                case PUT:
                    hm = new HttpPut(uri);
                    break;
                case DELETE:
                    hm = new HttpDelete(uri);
                    break;
                case HEAD:
                    hm = new HttpHead(uri);
                    break;
                case OPTIONS:
                    hm = new HttpOptions(uri);
                    break;
                case TRACE:
                    hm = new HttpTrace(uri);
                    break;
                case PATCH:
                    hm = new HttpPatch(uri);
                    break;
                default:
                    hm = new HttpGet(uri);
                    break;
            }
        } else hm = new HttpGet(uri);
        return hm;
    }
private static HttpRequestBase getHttpMethod ( RequestMethod method , String uri ) { HttpRequestBase hm ; if ( method != null ) { switch ( method ) { case POST : hm = new HttpPost ( uri ) ; break ; case GET : hm = new HttpGet ( uri ) ; break ; case PUT : hm = new HttpPut ( uri ) ; break ; case DELETE : hm = new HttpDelete ( uri ) ; break ; case HEAD : hm = new HttpHead ( uri ) ; break ; case OPTIONS : hm = new HttpOptions ( uri ) ; break ; case TRACE : hm = new HttpTrace ( uri ) ; break ; case PATCH : hm = new HttpPatch ( uri ) ; break ; default : hm = new HttpGet ( uri ) ; break ; } } else hm = new HttpGet ( uri ) ; return hm ; }
Get Http method instance by {@link com.rockagen.commons.http.RequestMethod}

@param method {@link RequestMethod}
@param uri  the uri
@return {@link HttpRequestBase}
Get Http method instance by { @link com . rockagen . commons . http . RequestMethod }