private void addQueryParameters ( HttpRequestBase request , Map < String , String > params ) { if ( params != null ) { URIBuilder builder = new URIBuilder ( request . getURI ( ) ) ; for ( Map . Entry < String , String > param : params . entrySet ( ) ) { builder . addParameter ( param . getKey ( ) , param . getValue ( ) ) ; } try { request . setURI ( builder . build ( ) ) ; } catch ( URISyntaxException e ) { throw new RuntimeException ( "Unable to construct API URI" , e ) ; } } }
Modifies request in place to add on any query parameters