skip to Main Content

Flutter Error: The method 'jsonEncode' is not defined

I am attempting to create a put request to an API using Flutter using the following function: Future<http.Response> login(String username, String password) { return http.put( Uri.parse('apiurl'), headers: <String, String>{ 'Content-Type': 'application/json; charset=UTF-8', }, body: jsonEncode( <String, String>{'username': username, 'password': password}));…

VIEW QUESTION
Back To Top
Search