educative.io

Educative

Some problem http response code error

Problem in apiResponse code Error.
Change http.get(apiEndPoint) to http.get(Uri.parse(apiEndPoint));

1 Like

@Dipprokash_sardar Can you show us the error, please?

Hi, here is the error i get before adding the Uri.parse:

String apiEndPoint

Type: String

The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’.dartargument_type_not_assignable

Hi @John_Vogel

I haven’t faced any issues or errors when executing the code, can you please share the screenshot of the error you are facing?

hi, thanks for looking into this :).

note, the yaml had a newer version, but I changed it while debugging the issue to see if it would fix the problem (it didnt)didn’t.



Hi @John_Vogel
Add the following package under the dependencies section:

dependencies: 
     flutter:   
        sdk: flutter  
    http: ^0.12.0+1

Consider adding all the packages and versions same as mentioned in the lesson so that you can run the code successfully.

Hope it will help, Thank you!

1 Like

hi, sorry for the trouble.

I initially used the class version, but, for some reason that escapes me, I upped the version…

I went back to the old version and the class runs properly. :slight_smile:

Best regards,
John

2 Likes

Hi @John_Vogel,
Good to hear that your problem is solved.Hope you have an amazing learning experience on Educative!:blush: