Code example for HttpRequest

Methods: setHeader

0
    } 
 
 
    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) {
        return createOpenRosaHttpPost(uri, "");
    } 
 
 
    public static final HttpPost createOpenRosaHttpPost(URI uri, String auth) {
        HttpPost req = new HttpPost(uri);
        setOpenRosaHeaders(req);
        setGoogleHeaders(req, auth);
        return req;
    }