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 cached version of the body.
Gets a cached version of the body. The returned instance will provide an implementation of 'asBytes', which is needed during digest authentication for example.
Gets the content type.
Gets the function that consumes this request body.
Gets a string representation of the body, if possible.
Gets a string representation of the body, if possible. Otherwise, "..." is returned.
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.
The hash code is computed from asBytes
merged with the hash code from the media type.
The hash code is computed from asBytes
merged with the hash code from the media type.
Gets the string representation and the content type for diagnostic purposes.
Carries body data on a request. The body data is supplied by a closure using the target HTTP output stream as its parameter, allowing data to be streamed from an arbitrary source in order to minimise memory footprint, if required.
The companion object provides apply methods for common sources of body data.