http icon indicating copy to clipboard operation
http copied to clipboard

randomly missing commas and quotes from response json

Open bagusindrayana opened this issue 1 year ago • 1 comments

i try to GET request to rest api with HttpClient, http or dio and always get FormatException when try to decode the response only if using emulator and if data is big, like 5 mb json data or thousand of row, i try in real device and didn't experience any problems.

here example from Exception result, there comma and quotes missing in in several position and always change every request even is same endpoint and same data

first request image

second request image

third request image

i also try to log the string response and try to validate with jsonlint and there always missing comma or quotes

package version : http: ^1.2.0 dio: ^5.4.3+1

flutter doctor : [√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.22631.3447], locale en-ID) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.0) [√] Android Studio (version 2022.2) [√] Android Studio (version 2023.3) [√] VS Code (version 1.89.1) [√] Connected device (4 available) [√] Network resources

my code :

var url = Uri.parse(baseUrl + '/asset');
var response = await http.get(url);
dynamic responseData = jsonDecode(response.body.toString());

bagusindrayana avatar May 29 '24 14:05 bagusindrayana

Hi @bagusindrayana ,

Would you provide a reproducible example?

brianquinlan avatar Jul 11 '24 18:07 brianquinlan