v1.0.16 utf8 decoding
This commit is contained in:
+18
-2
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:workouttest_util/model/cache.dart';
|
||||
import 'package:workouttest_util/service/api.dart';
|
||||
@@ -9,7 +11,6 @@ main() {
|
||||
});
|
||||
|
||||
group('api', () {
|
||||
|
||||
test('connect api auth successfully', () async {
|
||||
var api = APIClient();
|
||||
var responseJson = await api.authenticateUser("bosi", "andio2009");
|
||||
@@ -27,5 +28,20 @@ main() {
|
||||
final body = await api.get("app_package", "");
|
||||
print(body);
|
||||
});
|
||||
|
||||
test('test customer conversation in utf8', () async {
|
||||
var api = APIWebClient();
|
||||
var responseJson = await api.authenticateUser("bosi", "andio2009");
|
||||
print(responseJson);
|
||||
Cache().authToken = responseJson['token'];
|
||||
final body = await api.get("customer_conversation/72", "");
|
||||
|
||||
List<int> bytes3 = base64.decode(body);
|
||||
String decodedString = utf8.decode(bytes3);
|
||||
print(decodedString);
|
||||
|
||||
final body2 = await api.get("meal/21", "");
|
||||
print(body2);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user