Code example for DefaultHttpClient

Methods: execute

0
        qparams.add(new BasicNameValuePair("sender", sender));
        qparams.add(new BasicNameValuePair("msg", message));
        String url = targetUrl + "?" + URLEncodedUtils.format(qparams, "UTF-8");
 
        try { 
	        HttpClient client = new DefaultHttpClient();  
	        HttpGet get = new HttpGet(url);
	         
	        HttpResponse responseGet = client.execute(get);  
	        HttpEntity resEntityGet = responseGet.getEntity();  
	        if (resEntityGet != null) {  
	        	String resp = EntityUtils.toString(resEntityGet);
	        	Log.e("KALSMS", "HTTP RESP" + resp);
	            return resp;
	        } 
		} catch (Exception e) {
			Log.e("KALSMS", "HTTP REQ FAILED:" + url);
			e.printStackTrace();
		} 
		 
Stop searching for code, let great code find you!  Add Codota to your java IDE