-
public class StreamOkHttpInterceptorsProvides a set of OkHttp interceptors for use with the Stream SDKs.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StreamOkHttpInterceptorsINSTANCE
-
Method Summary
Modifier and Type Method Description final Interceptorauth(String authType, StreamTokenManager tokenManager, StreamJsonSerialization jsonParser)Creates an OkHttp interceptor that adds authentication headers and retries on token errors. final InterceptorconnectionId(StreamConnectionIdHolder connectionIdHolder)Creates an OkHttp interceptor that adds a connection_idquery parameter to the request URL.final InterceptorclientInfo(StreamHttpClientInfoHeader clientInfoHeader)Creates an OkHttp interceptor that adds the client info header to the request. final InterceptorapiKey(StreamApiKey apiKey)Creates an OkHttp interceptor that adds the Stream API key to the request as a query parameter. final Interceptorerror(StreamJsonSerialization jsonParser)Creates an OkHttp interceptor that parses and throws io.getstream.android.core.api.model.exceptions.StreamEndpointException for error responses. -
-
Method Detail
-
auth
final Interceptor auth(String authType, StreamTokenManager tokenManager, StreamJsonSerialization jsonParser)
Creates an OkHttp interceptor that adds authentication headers and retries on token errors.
- Parameters:
authType- The value set on thestream-auth-typeheader (e.g., "jwt").tokenManager- Provides, invalidates, and refreshes tokens.jsonParser- JSON parser used to decode error payloads when requests fail.
-
connectionId
final Interceptor connectionId(StreamConnectionIdHolder connectionIdHolder)
Creates an OkHttp interceptor that adds a
connection_idquery parameter to the request URL.- Parameters:
connectionIdHolder- The holder that provides the connection ID.
-
clientInfo
final Interceptor clientInfo(StreamHttpClientInfoHeader clientInfoHeader)
Creates an OkHttp interceptor that adds the client info header to the request.
- Parameters:
clientInfoHeader- The client info header to add.
-
apiKey
final Interceptor apiKey(StreamApiKey apiKey)
Creates an OkHttp interceptor that adds the Stream API key to the request as a query parameter.
- Parameters:
apiKey- The API key to add.
-
error
final Interceptor error(StreamJsonSerialization jsonParser)
Creates an OkHttp interceptor that parses and throws io.getstream.android.core.api.model.exceptions.StreamEndpointException for error responses.
- Parameters:
jsonParser- JSON parser used to decode error payloads when requests fail.
-
-
-
-