private void sendRESTMessage ( String url ) { HttpInputStream response = null ; try { logger . debug ( "Getting " + url ) ; response = _webClient . get ( url , false , _gSearchCredentials ) ; int code = response . getStatusCode ( ) ; if ( code != 200 ) { logger . warn ( "Error sending update to GSearch service (url=" + url + "). HTTP response code was " + code + ". " + "Body of response from GSearch follows:\n" + getString ( response ) ) ; } } catch ( Exception e ) { logger . warn ( "Error sending update to GSearch service via URL: " + url , e ) ; } finally { if ( response != null ) { try { response . close ( ) ; } catch ( Exception e ) { logger . warn ( "Error closing GSearch response" , e ) ; } } } }
Performs the given HTTP request logging a warning if we don t get a 200 OK response .