简体   繁体   中英

Display the complete json data from API response in flutter

I'm getting the json data from the API call but its not displaying the complete data.There are a lot of properties to work with and creating the model would be difficult as it's my first time working on any API.So i wanted to use app.quicktype.io to parse the json data directly into dart code for which i need to get the complete json data.Right now only little bit of the json data is being displayed in the console.

CODE:

Future<void> getContacts() async {
    var client = http.Client();
    String contacts_url =
        'https://mylinkexample.com';
    String basicAuth =
        'Basic mykeyexampele';
    var response = await client.get(contacts_url,
        headers: <String, String>{'authorization': basicAuth});
    var jsonString = jsonDecode(response.body);
    print(response.statusCode);
    print(jsonString);
  }

Use this:

import 'dart:developer' as developer;

test() {
  developer.log(response.body);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM