Code example for HttpMessage

Methods: addHeader

0
 
        return formList;
    } 
 
    protected void initHttpHeader(final HttpMessage httpMessage) {
        httpMessage.addHeader("Accept-Charset", "UTF-8;");
        httpMessage.addHeader("Cache-Control", "no-cache");
        httpMessage.addHeader("Connection", "keep-alive");
        httpMessage.addHeader("Pragma", "no-cache");
        httpMessage.addHeader("User-Agent", this.buildUserAgent());
    } 
 
    protected String buildUserAgent() {
        final StringBuilder userAgent = new StringBuilder();
        userAgent.append("Android/").append(Build.VERSION.RELEASE).append(" ");
        userAgent.append("(");
        userAgent.append(Build.MODEL).append(" ");
        userAgent.append("SDK/").append(Build.VERSION.SDK_INT);
        userAgent.append(")").append(" ");
        userAgent.append(TongrenluApplication.getApplicationVersionName());
        return userAgent.toString();