void json=(v)

JSON encodes a serialized value into body and sets contentType.

This method will encode v as JSON data and set it as the body of this request. v must be encodable to JSON (Maps, Lists, Strings, ints, etc.). The contentType will be set to ContentType.JSON.

Source

set json(dynamic v) {
  setBody(v, contentType: ContentType.JSON);
}