ResponseBody.fromString constructor

ResponseBody.fromString(
  1. String text,
  2. int? statusCode, {
  3. Map<String, List<String>> headers = const {},
  4. String? statusMessage,
  5. bool isRedirect = false,
})

Implementation

ResponseBody.fromString(
  String text,
  this.statusCode, {
  this.headers = const {},
  this.statusMessage,
  this.isRedirect = false,
}) : stream = Stream.value(Uint8List.fromList(utf8.encode(text)));