the writer function
the media type
Gets a byte array representation of the body, if possible.
Gets a byte array representation of the body, if possible. Some implementations do not provide this.
Be careful with this array - you *should not* attempt to modify it, even though it is mutable (which it is because otherwise an extra copy step would be needed, which would impair performance, and the array would not be available to the many standard Java APIs that work with such data).
Gets a string representation of the body, if possible.
Gets a string representation of the body, if possible. Otherwise, "..." is returned.
Converts this body to a new BinaryRequestBody
.
Converts this body to a new BinaryRequestBody
.
the media type
the media type
Gets the function that consumes this request body.
Gets the function that consumes this request body.
Equality between two instances is defined in terms of equality of both the byte content and the media type.
Equality between two instances is defined in terms of equality of both the byte content and the media type.
another instance, typically of a RequestBody
true iff two instances return the same results from asBytes
, and they
share the same media type, then they are equal.
Gets the string representation and the content type for diagnostic purposes.
Gets the string representation and the content type for diagnostic purposes.
Provides a request body based on an arbitrary function that writes data to an output stream, without any inherent caching of the body data. It is possible to obtain a cached version of this body; a
BinaryRequestBody
will be returned. It is normally more convenient to construct instances viaRequestBody
.