dio icon indicating copy to clipboard operation
dio copied to clipboard

response.data is only working with some versions

Open Manasmd opened this issue 2 years ago • 2 comments

I recently built my app for android from my office computer, though the code is synchronised through git. When I built the app, suddenly all the API calls are not working. When I looked into the issue, the response.data is no longer working.

` void getHttp() async { try { var response = await Dio().get('http://www.google.com'); print(response.data); ---> no longer can access .data } catch (e) { print(e); } }

`

Manasmd avatar Jun 21 '22 12:06 Manasmd

for me it's returning no value when i try to print it with whencomplete

ldsouza93 avatar Jun 22 '22 20:06 ldsouza93

ok I installed the latest version of the package and it seems to be working fine now.

My project was using "dio: ^4.0.0"

I changed it to "dio: ^4.0.6"

so my theory is that, the project was probably installing a random version in between "4.0.0" - "4.0.6", which probably didn't have support for "response.data" or wasn't returning a Map.

@ldsouza93 try setting it to the latest version and re-build the application

Manasmd avatar Jun 23 '22 07:06 Manasmd