putJSON method

Future putJSON(
  1. String path, {
  2. Map<String, String>? headers,
  3. Credential? authorization,
  4. Object? body,
  5. String? contentType,
})

Does a PUT request and returns a decoded JSON.

Implementation

Future<dynamic> putJSON(String path,
    {Map<String, String>? headers,
    Credential? authorization,
    Object? body,
    String? contentType}) async {
  return put(path,
          headers: headers,
          authorization: authorization,
          body: body,
          contentType: contentType)
      .then((r) => _jsonDecode(r.bodyAsString));
}