Gets the body as an array of raw bytes.
Converts the body to a string.
Converts the body to a string. An exception is thrown if the data is binary; use isTextual
to
detect whether this is so.
Gets the length of the content as the number of bytes received.
Gets the length of the content as the number of bytes received. If compressed on the wire, this will be the uncompressed length so will differ from the 'Content-Length' header. Because 'contentLength' represents the byte array size, 'asString.length' will probably compute a different value.
Gets the content type and encoding of the response.
Gets the content as an input stream.
Tests whether the implementation has not yet buffered the whole response body.
Tests whether the implementation has not yet buffered the whole response body. If this returns true,
toBufferedBody
provides an easy route to accumulate the entire body in a buffer.
Converts this response body into a buffered form if necessary.
Converts this response body into a buffered form if necessary. If it is already buffered, this method simply
returns this
.
Converts this response body into a buffered form as a string if necessary.
Converts this response body into a buffered form as a string if necessary. If it is already a string,
this method simply returns this
.
Closes the input stream that provides the data for this response.
Closes the input stream that provides the data for this response. If the implementation buffers the body, the input stream will have been closed automatically.
Tests whether the implementation has buffered the whole response body.
Tests whether the implementation has buffered the whole response body. If this returns false, toBufferedBody
provides an easy route to accumulate the entire body in a buffer.
Tests whether this response body can be represented as text, or whether the data is binary.
Gets the body as a string split into lines, if available.
Gets the body as a string split into lines, if available. This is only possible for textual content. An IllegalStateException is thrown if the data is binary.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Gets the response body as a string for diagnostic purposes.
Gets the response body as a string for diagnostic purposes.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Defines the outline of a response body. This may or may not be buffered in memory or streamed directly to where it is needed, depending on the implementation.
When the content is textual, instances may be used as an Iterable[String], which provides a way of accessing the text line by line.