Code example for HttpRequestBase

Methods: addHeader

0
    this.mContentType = paramString3;
  } 
 
  public void addHeaders(HttpRequestBase paramHttpRequestBase)
  { 
    paramHttpRequestBase.addHeader("Accept-Encoding", "gzip");
    paramHttpRequestBase.addHeader("Accept-Language", Locale.getDefault().toString());
    paramHttpRequestBase.addHeader("User-Agent", getUserAgentHeader(this.mContext));
    paramHttpRequestBase.addHeader("Content-Type", this.mContentType);
    if (this.mAccount != null);
    try 
    { 
      ApiaryAuthDataFactory.ApiaryAuthData localApiaryAuthData = ApiaryAuthDataFactory.getAuthData(this.mScope);
      String str2 = localApiaryAuthData.getAuthToken(this.mContext, this.mAccount.getName());
      String str3 = Long.toString(localApiaryAuthData.getAuthTime(str2).longValue());
      paramHttpRequestBase.addHeader("Authorization", "Bearer " + str2);
      paramHttpRequestBase.addHeader("X-Auth-Time", str3);
      String str1 = RealTimeChatService.getStickyC2dmId(this.mContext);
      if (str1 != null)
        paramHttpRequestBase.addHeader("X-Android-App-ID", str1);
      if (!TextUtils.isEmpty(this.mBackendOverrideUrl))
      { 
        if (EsLog.isLoggable("HttpTransaction", 3)) 
          Log.d("HttpTransaction", "Setting backend override url " + this.mBackendOverrideUrl);
        paramHttpRequestBase.addHeader("X-Google-Backend-Override", this.mBackendOverrideUrl);
      } 
      return; 
    } 
    catch (Exception localException)
    {