Class ContentTypeInterceptor
- java.lang.Object
-
- com.contentful.java.cma.interceptor.ContentTypeInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
public class ContentTypeInterceptor extends java.lang.Object implements okhttp3.InterceptorInterceptor to add content type header to requests
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHEADER_NAME
-
Constructor Summary
Constructors Constructor Description ContentTypeInterceptor(java.lang.String contentType)Create Header interceptor, saving parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)Method called by framework, to enrich current request with the header information requested.
-
-
-
Field Detail
-
HEADER_NAME
public static final java.lang.String HEADER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws java.io.IOExceptionMethod called by framework, to enrich current request with the header information requested.- Specified by:
interceptin interfaceokhttp3.Interceptor- Parameters:
chain- the execution chain for the request.- Returns:
- the response received
- Throws:
java.io.IOException- if chain had an error
-
-