From 3d1ff99fb50975561a74b2713f0de0b0e1f47483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Mielcarek?= Date: Mon, 7 Nov 2022 16:39:39 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20probl=C3=A8me=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/dafl_project_flutter/lib/api/api.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/dafl_project_flutter/lib/api/api.dart b/Sources/dafl_project_flutter/lib/api/api.dart index 574d995..c89ff72 100644 --- a/Sources/dafl_project_flutter/lib/api/api.dart +++ b/Sources/dafl_project_flutter/lib/api/api.dart @@ -58,14 +58,12 @@ class Api { getCurrentlyPlayingTrack() async { var url = Uri.https('api.spotify.com', 'v1/me/player/currently-playing'); - print('$token_type $access_token'); - var response = await client.post(url, headers: { + var response = await client.get(url, headers: { 'Authorization': '$token_type $access_token', 'Content-Type': 'application/json' }); - // Problem while trying to get body - print(access_token); - print(response.statusCode); + // Implement traitement of datas + print(response.body); } // for state value