putBody method

Future<String> putBody(
  1. Uri uri, {
  2. Map<String, String>? headers,
})

Returns the body of the given uri after a PUT request. This process is async, thus the body is returned as a future String instance.

Implementation

Future<String> putBody(Uri uri, {Map<String, String>? headers}) async {
  final res = await putResponse(uri, headers: headers);
  if (isErrorCode(res.statusCode)) {
    throw SessionInvalidException(res.statusCode);
  }
  return res.body;
}