Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Akshay sharma akshay2211

🎯
Focusing
Block or report user

Report or block akshay2211

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@akshay2211
akshay2211 / Interceptor.java
Created Sep 5, 2017 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
View Interceptor.java
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON
You can’t perform that action at this time.