RequestBody
A request body: its bytes and an optional content type.
Stable Core. The constructor's shape is frozen. The bytes are copied in and read back as copies. Equality is identity. toString() prints the size and whether a content type is set, never the bytes or the type.
Parameters
bytes
the body; copied.
contentType
an RFC 9110 media type (its visible-ASCII subset), or null for none.
Throws
if contentType is not a media type; the message holds the failing index, not the text.