Code example for HttpRequest

Methods: setHeader

0
            @Override 
            public void process(HttpRequest request, HttpContext context) throws HttpException, IOException
            { 
                Locale locale = Locale.getDefault();
                String localeStr = locale.getLanguage() + "_" + locale.getCountry();
                request.setHeader("User-Agent", "BTNetwork (Android; Android OS " + Build.VERSION.RELEASE + "; " + localeStr + ")");
                /*Header[] headers = request.getAllHeaders(); 
                for (Header h : headers) { 
                    Log.d(TAG, h.getName() + ": " + h.getValue()); 
                }*/ 
            } 
        }); 
 
        /* 
        // Create AuthCache instance 
        AuthCache authCache = new BasicAuthCache(); 
        // Generate BASIC scheme object and add it to the local 
        // auth cache 
        BasicScheme basicAuth = new BasicScheme(); 
        authCache.put(targetHost, basicAuth);