void setBody(body, { ContentType contentType })

Sets the body and contentType.

On execution, body will be encoded according to contentType. contentType defaults to ContentType.JSON.

Source

void setBody(dynamic body, {ContentType contentType}) {
  this.contentType = contentType ?? ContentType.JSON;
  this.body = body;
}