Code example for HttpRequest

Methods: setHeader, x 1

0
        return cookie;
    } 
     
 
    private void setHeaders(HttpRequest method) {
        method.setHeader("Accept",
                "text/html,application/xhtml+xml,application/xml;"); 
        method.setHeader("Accept-Language", "zh-cn");
        method.setHeader(
                        "User-Agent", 
                        "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"); 
        method.setHeader("Accept-Charset", encoding);
        method.setHeader("Keep-Alive", "300");
        method.setHeader("Connection", "Keep-Alive");
        method.setHeader("Cache-Control", "no-cache");
    } 
     
    private void addCookie() { 
        final String COOKIE_PATH = "resources/cookie";
        String[] cookieTokens = FileUtil.getContents(COOKIE_PATH).replace("\r\n", "").split("; ");
        for (String cookieToken : cookieTokens) {