Code example for HttpRequest

Methods: setHeader

0
package org.tcm.gll.request; 
 
import org.apache.http.HttpRequest; 
import org.apache.http.message.BasicHeader; 
 
public class StandardHeaders { 
 
    public void addToRequest(HttpRequest request) {
        request.setHeader(new BasicHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"));
        request.setHeader(new BasicHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.3"));
        request.setHeader(new BasicHeader("Accept-Encoding", "gzip,deflate,sdch"));
        request.setHeader(new BasicHeader("Accept-Language", "en-US,en;q=0.8"));
        request.setHeader(new BasicHeader("Cache-Control", "max-age=0"));
        request.setHeader(new BasicHeader("Connection", "keep-alive"));
        request.setHeader(new BasicHeader("Host", "gll.legendonlineservices.co.uk"));
        request.setHeader(new BasicHeader("Referer", "https://gll.legendonlineservices.co.uk/enterprise/account/CSC"));
        request.setHeader(new BasicHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.942.0 Safari/535.8"));
    } 
 
}