-
-
Save alejo8591/8bae59c291f0c5e8d544686612f6061b to your computer and use it in GitHub Desktop.
Retrofit2 interceptor to add headers to HTTP requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AddHeaderInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request.Builder builder = chain.request().newBuilder(); | |
builder.addHeader("Authorization", "headerContent"); | |
return chain.proceed(builder.build()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment