bodyAsBytes
Returns the current body of the target Response.
This method will throw ResponseBytesException if the body cannot be read. This can be due to a connection issue, for example.
An exception will also be thrown if you try to read a body that has previously been read! So, you are only expected to call this method once per response. (Remember, you can call Response.clone if you plan to read the contents of a response more than that.)
Be aware that responses that are not ok can still have bodies! For example, a server might add details about the error in there.
However, by default, this method is designed for the happy path where good bytes go in with a request and good bytes come back out with a response. Therefore, it will throw for an response with an error code even if there's a body. You can change requireOk if you want the body of "bad" responses to also be returned.