Replies: 2 comments 1 reply
-
I rewrite my code: void main() { class MainApp extends StatefulWidget { @OverRide class _MainAppState extends State { @OverRide class Service extends GetConnect { Future<Map<String, dynamic>?> fetchData() async { like this the php script is not executed; the response.statuscode is equal 200 and the response.body is about " |
Beta Was this translation helpful? Give feedback.
-
Check yout test.php |
Beta Was this translation helpful? Give feedback.
-
I want to know why this function is not correct:
Future<Map<String, dynamic>?> fetchData() async {
GetConnect connect = GetConnect();
final Response response = await connect.get('192.168.1.21/test.php');
if (response.statusCode == 200) {
return {
'status': true,
'response': response.body,
};
} else {
return {'status': false, 'error': response.body};
}
}
The response.statuscode is correct (200) but the contents of response.body is this:
" etc.....
Beta Was this translation helpful? Give feedback.
All reactions