decode utf8
This commit is contained in:
parent
dac570fffc
commit
943895accb
@ -26,6 +26,6 @@ subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
@ -66,17 +66,17 @@ class _MyHomePageState extends State<MyHomePage> with ShowErrorDialog {
|
||||
String former = "";
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
var urlGet = Uri.parse("http://${globals.api}/users");
|
||||
var urlGet = Uri.parse("http://${globals.api}/events");
|
||||
|
||||
var responseGet = await http.get(urlGet,
|
||||
headers: {HttpHeaders.cookieHeader: 'access_token=${accessToken}'});
|
||||
stderr.writeln('Response Get status: ${responseGet.statusCode}');
|
||||
if (responseGet.statusCode == 200) {
|
||||
stderr.writeln('Username : ${responseGet.body}');
|
||||
var json = jsonDecode(responseGet.body);
|
||||
var json = jsonDecode(utf8.decode(responseGet.bodyBytes));
|
||||
for (var user in json) {
|
||||
stderr.writeln('email : ${user['email']}');
|
||||
former = "$former\n ${user['email']}";
|
||||
stderr.writeln('name : ${user['name']}');
|
||||
former = "$former\n ${user['name']} : ${user["place"]}";
|
||||
}
|
||||
} else {
|
||||
var text = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user