putJSON method

Future putJSON(
  1. HttpClient httpClient,
  2. String path, {
  3. bool fullPath = false,
  4. Credential? authorization,
  5. Object? body,
  6. String? contentType,
  7. String? accept,
  8. OnCachedResponse? onStaleResponse,
  9. Duration? staleResponseDelay,
})

Does a PUT request and decodes response to JSON.

Implementation

Future<dynamic> putJSON(HttpClient httpClient, String path,
    {bool fullPath = false,
    Credential? authorization,
    Object? body,
    String? contentType,
    String? accept,
    OnCachedResponse? onStaleResponse,
    Duration? staleResponseDelay}) async {
  return put(httpClient, path,
          fullPath: fullPath,
          authorization: authorization,
          body: body,
          contentType: contentType,
          accept: accept,
          onStaleResponse: onStaleResponse,
          staleResponseDelay: staleResponseDelay)
      .then((r) => r.json);
}