Code example for HttpGet

Methods: addHeader

0
    } 
 
    public HttpResponse GET(String url) throws ClientProtocolException,
            IOException { 
        String urlStr = buildUrl(url);
        HttpGet req = new HttpGet(urlStr);
 
 
 
 
        req.addHeader("Accept-Encoding", "gzip");
        DefaultHttpClient http = createHttpClient();
        Log.v("Loctouch", "GET " + urlStr);
       HttpResponse res = http.execute(req);
        return res;
    } 
 
    public HttpResponse POST(String url, HashMap<String, String> params)
            throws ClientProtocolException, IOException { 
        String urlStr = buildUrl(url);
        HttpPost req = new HttpPost(urlStr);