public class AuthorizationHeaderInterceptor extends Object implements okhttp3.Interceptor
| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_BEARER |
static String |
HEADER_NAME |
| Constructor and Description |
|---|
AuthorizationHeaderInterceptor(String token)
Create Header interceptor, saving parameters.
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
Method called by framework, to enrich current request with the header information requested.
|
public static final String HEADER_NAME
public static final String HEADER_BEARER
public AuthorizationHeaderInterceptor(String token)
token - the access token to be used with *every* request.public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept in interface okhttp3.Interceptorchain - the execution chain for the request.IOException - if a problem happenedCopyright © 2017 Contentful, GmbH.. All Rights Reserved.