Skip to content

Instantly share code, notes, and snippets.

Avatar

Akshay sharma akshay2211

View GitHub Profile
View gist:2686e44f56634880465e8630ac5f8342
# sudo su and run the following
sudo aptitude update
# install all dependencies
sudo aptitude -y install \
python-pip \
python2.7-dev \
libssl-dev \
libcurl4-openssl-dev \
@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.