I'm having trouble pulling XML data from a url. When I use http.get and print out the response.body - it looks like regular JSON. One of this issues is some of the XML nodes have attributes on them that I need to use. I'm still fairly new to Dart / Flutter so any help is REALLY appreciated. Here's my code for reference:
String url = "url_to_data_remote_data";
Future<DataModel> fetchData() async {
final response = await http.get(url);
if (response.statusCode == 200)
return DataModel.fromXML(response.body);
} else {
throw Exception('Failed to load post');
}
}