put method

Future<Response> put(
  1. String path, {
  2. Uint8List? bodyBytes,
})

Implementation

Future<http.Response> put(String path, {Uint8List? bodyBytes}) async {
  bodyBytes = bodyBytes ?? Uint8List(0);
  SignDetails signDetails = signer.sign("PUT", path, bodyBytes: bodyBytes);
  signDetails.headers["contentLengthHeader"] = bodyBytes.length.toString();

  final response = await client.put(
    Uri.parse("$_baseUrl/$identity$path"),
    headers: Map<String, String>.from(signDetails.headers),
    body: bodyBytes,
  );
  if (response.statusCode >= 400) throw Exception(response.body);
  return response;
}