Code example for HttpGet

Methods: addHeadersetHeader

		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;
			Log.i(TAG, request.getURI().toString());
			response = mClient.execute(request);			
		}catch(ClientProtocolException e){
			throw new ConnectionException(e);
Connect your IDE to all the code out there  Get Codota for Java