Class ApiKeyAuthenticationInterceptor

java.lang.Object
dev.voidframework.restclient.retrofit.interceptor.ApiKeyAuthenticationInterceptor
All Implemented Interfaces:
okhttp3.Interceptor

public final class ApiKeyAuthenticationInterceptor extends Object implements okhttp3.Interceptor
Provides API key authentication mechanism.
Since:
1.10.0
  • Constructor Details

    • ApiKeyAuthenticationInterceptor

      public ApiKeyAuthenticationInterceptor(String key, String value, ApiKeyAuthenticationInterceptor.AddTo addTo)
      Build a new instance.
      Parameters:
      key - The API key variable name
      value - The API key value
      addTo - Where to add the API key (ie: HEADERS)
      Since:
      1.10.0
  • Method Details

    • intercept

      public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      IOException