Skip to content

Instantly share code, notes, and snippets.

@showsky
Created August 27, 2013 02:42
Show Gist options
  • Save showsky/6349110 to your computer and use it in GitHub Desktop.
Save showsky/6349110 to your computer and use it in GitHub Desktop.
For Vincent Nike API JAVA Version
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class Nike {
public static void main(String[] args) throws Exception {
String baseURL = "https://api.nike.com/me/sport?access_token=";
String tok = "";
StringBuffer response = new StringBuffer();
URL url = new URL(baseURL + tok);
URLConnection conn = url.openConnection();
conn.setRequestProperty("appid", "fuelband");
conn.setRequestProperty("Accept", "application/json");
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
response.append(line);
}
System.out.println(response.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment