Code example for HttpRequest

Methods: setHeader

0
		for(AuthScope a:asList){
			credsProvider.setCredentials(a, c);
		} 
	} 
	private static final void setOpenRosaHeaders(HttpRequest req){
		req.setHeader(OPEN_ROSA_VERSION_HEADER, OPEN_ROSA_VERSION);
		g.setTime(new Date());
		req.setHeader(DATE_HEADER, DateFormat.format("E,dd MMM yyyy hh:mm:ss zz	",g).toString());
	} 
	public static final HttpHead createOpenRosaHttpHead(URI uri) {
        HttpHead req = new HttpHead(uri);
        setOpenRosaHeaders(req);
        return req;
    } 
 
 
    public static final HttpGet createOpenRosaHttpGet(URI uri) {
        return createOpenRosaHttpGet(uri, "");
    } 
 
 
    public static final HttpGet createOpenRosaHttpGet(URI uri, String auth) {
        HttpGet req = new HttpGet();
        setOpenRosaHeaders(req);
        setGoogleHeaders(req, auth);
        req.setURI(uri);
        return req;
    } 
 
 
    public static final void setGoogleHeaders(HttpRequest req, String auth) {
        if ((auth != null) && (auth.length() > 0)) {
            req.setHeader("Authorization", "GoogleLogin auth=" + auth);
        } 
    } 
 
 
    public static final HttpPost createOpenRosaHttpPost(URI uri) {