getJSON method

Future getJSON(
  1. String path, {
  2. Map<String, String>? headers,
  3. Credential? authorization,
  4. Map<String, Object?>? parameters,
})

Does a GET request and returns a decoded JSON.

Implementation

Future<dynamic> getJSON(String path,
    {Map<String, String>? headers,
    Credential? authorization,
    Map<String, Object?>? parameters}) async {
  return get(path,
          headers: headers,
          authorization: authorization,
          parameters: parameters)
      .then((r) => _jsonDecode(r.bodyAsString));
}