Skip to content

Instantly share code, notes, and snippets.


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 /
Created Sep 5, 2017 — forked from alex-shpak/
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
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.