I'm trying to make a post request from my flutter mobile application to a laravel api hosted on ionos.
The problem I encounter is that on some android smartphone, when the form is submitted, sometimes the progress loader load indefinitly without showing errors and sometimes it work imediately.
I have increased the alive time out int .htaccess file of my laravel app
<ifModule mod_env.c>
SetEnv KeepAlive On
SetEnv KeepAliveTimeout 100
SetEnv MaxKeepAliveRequests 500
</ifModule>
<ifModule mod_headers.c>
Header unset Connection
Header set Connection keep-alive
Header unset Keep-Alive
Header set Keep-Alive timeout=100,max=500
</ifModule>
But the problem persist, it work successfully on some devices (most recent smartphones) and not on other sometimes.
Please help me, I'm facing the issue since 2 days
The flutter/dart code
sendHouse() async {
String url = ServerConfigs.api_url + "/house";
final Map<String, dynamic> house = new Map<String, dynamic>();
house['name'] = name;
house['img'] = image.path.split("/").last;
List<int> imageBytes = image.readAsBytesSync();
house['img64'] = Base64Codec().encode(imageBytes);
house['lat'] = lat;
house['lon'] = lon;
final response = await http.post(url, headers: {
'Accept': 'application/json',
'Authorization': 'Bearer ' + ServerConfigs.bearer_token
}, body: {
"data": house
});
var data = await json.decode(response.body);
if (response.statusCode == 200) {
emitSuccess();
} else {
print(data);
print(response.statusCode);
emitFailure();
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…