private static void prepareHttpRequest ( final HttpUriRequest request , final String basicAuthUsername , final String basicAuthPassword , final Map < String , Object > parameters ) { if ( StringUtils . isNotBlank ( basicAuthUsername ) && StringUtils . isNotBlank ( basicAuthPassword ) ) { val auth = EncodingUtils . encodeBase64 ( basicAuthUsername + ' ' + basicAuthPassword ) ; request . setHeader ( HttpHeaders . AUTHORIZATION , "Basic " + auth ) ; } }
Prepare http request . Tries to set the authorization header in cases where the URL endpoint does not actually produce the header on its own .