RequestBody.text constructor

RequestBody.text(
  1. String text, {
  2. String? contentType,
})

Creates a plain-text body.

Implementation

factory RequestBody.text(String text, {String? contentType}) => RequestBody._(
      type: BodyType.text,
      value: text,
      contentType: contentType ?? 'text/plain; charset=utf-8',
    );