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