Code example for HttpGet

0
		} 
        return false; 
	} 
 
	private InputStream getUrl(String url) throws Exception {
		HttpGet request = new HttpGet(url);
		HttpResponse response = executeRequest(request);
		HttpEntity entity = response.getEntity();
		if (entity != null) {
			InputStream instream = entity.getContent();
            return instream;
		} 
		return null; 
	} 
 
    private void putUrl(String url, String data) throws Exception {
        HttpPut put = new HttpPut(url);
        put.setEntity(new StringEntity(data));
        HttpResponse response = executeRequest(put);
    } 
Experience pair programming with AI  Get Codota for Java