Code example for HttpGet

Methods: setURI

0
	private static boolean caughtIOException = false;
 
	public Pair<String, Integer> getPush(URI uri) {
		AndroidHttpClient client = AndroidHttpClient.newInstance(userAgent);
 
		HttpGet request = new HttpGet();
		request.setURI(uri);
		HttpResponse response = null;
		try { 
			response = client.execute(request);
		} catch (SocketTimeoutException e) {
			// forget it--we don't care that the user couldn't connect 
			// TODO log this to JS 
		} catch (IOException e) {
			if(!caughtIOException) {
				caughtIOException = true;
				logger.log(e);
			} 
		} 
		if (response != null) {
			StatusLine statusLine = response.getStatusLine();