put method

Future<Map<String, dynamic>> put(
  1. String path, {
  2. Map<String, dynamic>? body,
})

Make a PUT request with JSON body.

Implementation

Future<Map<String, dynamic>> put(
  String path, {
  Map<String, dynamic>? body,
}) async {
  final uri = _uri(path);
  _log(FirestackLogLevel.verbose, 'PUT $uri');
  final response = await _withRetry(
    'PUT $path',
    () => _httpClient.put(
      uri,
      headers: _headers,
      body: body != null ? jsonEncode(body) : null,
    ),
  );
  return _handleResponse(response);
}