Back to project page UPPlatform_Android_SDK.
The source code is released under:
Apache License
If you think the Android project UPPlatform_Android_SDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * @author Omer Muhammed// ww w . ja v a 2 s . c o m * Copyright 2014 (c) Jawbone. All rights reserved. * */ package com.jawbone.upplatformsdk.api; import retrofit.RequestInterceptor; /** * Small class to dynamically add the required headers to the API calls. */ public class ApiHeaders implements RequestInterceptor { private String accessToken; public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public void clearAccessToken() { accessToken = null; } @Override public void intercept(RequestInterceptor.RequestFacade request) { if (accessToken != null) { request.addHeader("Authorization", "Bearer " + accessToken); request.addHeader("Accept", "application/json"); } } }