Code example for HttpGet

Methods: addHeadersetHeader

0
		} 
		return result;		
	} 
	 
	private HttpGet getRequest(String url){
		HttpGet get = new HttpGet(url);
		get.setHeader("User-Agent", USER_AGENT);
		get.addHeader("Authorization", "Basic " + getCredentials());
		get.addHeader("Accept", "application/json");
		return get;
	} 
	 
	private HttpResponse doRequest(HttpRequestBase request) 
	throws ConnectionException, LoginException { 
		HttpResponse response;
		try{ 
			Log.i(TAG, request.getURI().toString());
			response = mClient.execute(request);			
		}catch(ClientProtocolException e){
			throw new ConnectionException(e);
Stop searching for code, let great code find you!  Add Codota to your java IDE