agave-common/common-core/src/main/java/org/iplantc/service/common/clients/RequestBin.java
/**
	 * Makes the HTTP request, checks response, and returns JSON object response.
	 * @param httpUriRequest
	 * @return JsonNode
	 * @throws IOException
	 */
Makes the HTTP request, checks response, and returns JSON object response.
Makes the HTTP request checks response and returns JSON object response .
@SuppressWarnings("deprecation")
	private JsonNode doRequest(HttpUriRequest httpUriRequest)
	throws IOException
	{
		DefaultHttpClient httpClient = null;
		try {
		    httpClient = new DefaultHttpClient();
		    HttpResponse response = httpClient.execute(httpUriRequest);
			int statusCode = response.getStatusLine().getStatusCode();
			if (statusCode >= 200 && statusCode < 300) 
			{
				JsonNode json = mapper.readTree(response.getEntity().getContent());
				log.debug("Response from request bin api: " + json.toString());
				return json;
			} 
			else 
			{
				throw new IOException("Error response received from Request Bin API at " + this + ": " + statusCode +
						" - " + response.getStatusLine().getReasonPhrase());
			}
		}
		finally {
			try {httpClient.close(); } catch (Exception e){}
		}
	}
@ SuppressWarnings ( "deprecation" ) private JsonNode doRequest ( HttpUriRequest httpUriRequest ) throws IOException { DefaultHttpClient httpClient = null ; try { httpClient = new DefaultHttpClient ( ) ; HttpResponse response = httpClient . execute ( httpUriRequest ) ; int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= 200 && statusCode < 300 ) { JsonNode json = mapper . readTree ( response . getEntity ( ) . getContent ( ) ) ; log . debug ( "Response from request bin api: " + json . toString ( ) ) ; return json ; } else { throw new IOException ( "Error response received from Request Bin API at " + this + ": " + statusCode + " - " + response . getStatusLine ( ) . getReasonPhrase ( ) ) ; } } finally { try { httpClient . close ( ) ; } catch ( Exception e ) { } } }
Makes the HTTP request, checks response, and returns JSON object response.
Makes the HTTP request checks response and returns JSON object response .
//			TrustStrategy acceptingTrustStrategy = new TrustStrategy() { //				@Override //				public boolean isTrusted(X509Certificate[] chain, String authType) //						throws CertificateException { //					return true; //				} //			}; //		    SSLSocketFactory sf = new SSLSocketFactory( //		      acceptingTrustStrategy, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); //		    SchemeRegistry registry = new SchemeRegistry(); //		    registry.register(new Scheme("https", 443, sf)); //			registry.register(new Scheme("http", 80, PlainConnectionSocketFactory.getSocketFactory())); //		    ClientConnectionManager ccm = new PoolingClientConnectionManager(registry); //		catch (KeyManagementException | UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException e) { //			throw new IOException("Request failed to requestbin.", e); //		}