Class HeaderInterceptor
java.lang.Object
org.shakespeareframework.retrofit.HeaderInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
Interceptor
to add headers to any request. This should be used to set authentication or
other contextual headers.-
Nested Class Summary
Nested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion
-
Field Summary
Fields inherited from interface okhttp3.Interceptor
Companion
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
HeaderInterceptor
public HeaderInterceptor()
-
-
Method Details
-
intercept
- Specified by:
intercept
in interfaceokhttp3.Interceptor
- Throws:
IOException
-
add
Adds a header that will be added to the intercepted request.- Parameters:
key
- name of the header to be addedvalue
- value of the header to be added
-
remove
Removes a header that will no longer be added to the intercepted request.- Parameters:
key
- name of the header to be removed
-