Code example for HttpGet

Methods: setHeader

0
	public void sendHttpGetRequest(String hostUrl) {
		 
		mServerAddress  = hostUrl;
				 
		// Set the headers 
    	HttpGet httpGet = new HttpGet(mServerAddress);
        httpGet.setHeader("Accept", "*/*");
        httpGet.setHeader("Accept-Encoding", "identity");
        httpGet.setHeader("X-Transcend-Version", "1");
         
        // Send the request Async 
        StatusLog.updateLog().updateStatusMsg("Sent Http Get request"); 
        HttpRequestAsync sendReqAsync  = new HttpRequestAsync(mMainActivity, this, mHttpContext, mErrorLogHandler);
        sendReqAsync.execute(httpGet);
	} 
	 
	public void sendHttpGetRequest(HttpGet httpGet) {
		 
		// Send the request Async to retrieve configuration file. 
        StatusLog.updateLog().updateStatusMsg("Sent Http Get request"); 
Stop searching for code, let great code find you!  Add Codota to your java IDE