Class UserAgentInterceptor

java.lang.Object
com.slack.api.util.http.UserAgentInterceptor
All Implemented Interfaces:
okhttp3.Interceptor

public class UserAgentInterceptor
extends java.lang.Object
implements okhttp3.Interceptor
An OkHttpClient interceptor that adds the SDK User-Agent to all the outgoing HTTP requests by this SDK.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface okhttp3.Interceptor

    okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String USER_AGENT_PREFIX  

    Fields inherited from interface okhttp3.Interceptor

    Companion
  • Constructor Summary

    Constructors 
    Constructor Description
    UserAgentInterceptor​(java.util.Map<java.lang.String,​java.lang.String> additionalInfo)  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String buildDefaultUserAgent​(java.util.Map<java.lang.String,​java.lang.String> additionalInfo)  
    okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • UserAgentInterceptor

      public UserAgentInterceptor​(java.util.Map<java.lang.String,​java.lang.String> additionalInfo)
  • Method Details

    • buildDefaultUserAgent

      public static java.lang.String buildDefaultUserAgent​(java.util.Map<java.lang.String,​java.lang.String> additionalInfo)
    • intercept

      public okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain) throws java.io.IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      java.io.IOException