Skip to content

Instantly share code, notes, and snippets.

@dinorahtovar
Created July 19, 2018 17:46
Show Gist options
  • Save dinorahtovar/eeb0e710b4daf7b3a62d2ea29f10e4bf to your computer and use it in GitHub Desktop.
Save dinorahtovar/eeb0e710b4daf7b3a62d2ea29f10e4bf to your computer and use it in GitHub Desktop.
/**
* Created by Dinorah Tovar on 04/04/18.
* Secondary helper interceptor to skip interceptor headers over Data Module
*/
class SupportInterceptor: Interceptor {
/**
* Interceptor class for setting of the headers for every request
*/
override fun intercept(chain: Interceptor.Chain): Response {
var request = chain.request()
request = request?.newBuilder()
?.addHeader("Content-Type", "application/json")
?.addHeader("Accept", "application/json")
?.build()
return chain.proceed(request)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment