classafButter::Body
sys::Obj afButter::Body
Convenience methods for reading and writing content.
- buf
Buf buf
Gets and sets the body content as a
Buf
.- charset
Charset? charset
The charset used to en / decode the string and json objects. If left as
null
then it defaults to theContent-Type
HTTP Header, or UTF-8 if not set.- jsonMap
Gets and set the body content as a JSON map. Convenience for
([Str:Obj?]?) body.jsonObj
.When set, the
Content-Type
is set toapplication/json
(if it's not been set already).- jsonObj
Obj? jsonObj
Gets and sets the body content as a JSON object.
JsonInStream
/JsonOutStream
are used to convert objects to and from JSON strings.When set, the
Content-Type
is set toapplication/json
(if it's not been set already).- str
Str? str
Gets and sets the body content as a string. The string is en / decodes using a charset found in the following precedence:
- any charset set via the
charset
field - the charset defined in a
Content-Type
HTTP header - UTF-8
When set, the
Content-Type
is set totext/plain
(if it's not been set already).- any charset set via the