0
我指的是https://dev.fitbit.com/apps/oauthinteractivetutorial獲取Android App中的訪問令牌的鏈接。如何從https://www.fitbit.com/oauth2/authorize獲取代碼
第1步:
在這裏,我硬編碼的註冊應用程序的詳細信息。
String urls = "https://www.fitbit.com/oauth2/authorize?" +
"response_type=code" +
"&client_id=228K7X" +
"&expires_in=2592000" +
"&scope=profile%20settings%20weight" +
"&redirect_uri=http://www.google.com/" ;
從這個環節,我應該得到Code.If我複製過去的這個瀏覽器我得到這樣的代碼
http://www.google.com/? 碼= e800eef2374bd6c1f5cc5e8dab65d4d4bff60406#=
我試着像下面android的代碼,但沒有得到預期的result.Can任何一個可以幫助我這個?
URL url = new URL(urls);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.connect();
InputStream inputStream = connection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(inputStream));
什麼是你希望要回到底是什麼?一個JSON對象? –