Package com.slack.api.util.http
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
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringUSER_AGENT_PREFIX -
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.StringbuildDefaultUserAgent(java.util.Map<java.lang.String,java.lang.String> additionalInfo)okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)
-
Field Details
-
USER_AGENT_PREFIX
public static final java.lang.String USER_AGENT_PREFIX- See Also:
- Constant Field Values
-
-
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:
interceptin interfaceokhttp3.Interceptor- Throws:
java.io.IOException
-