Looking at the code, I first thought that:
if(isNotNull(response.getResponseBody())) {
doSomethingWith(response.getResponseBodyAsStream)
}
would work, as it's just a different representation of the same response body. However, #getResponseBodyAsStream throws a NPE, because ResponseBodyPart#chunk = null.
The string-based #getResponseBody returns a valid content, the problem's in #getResponseBodyAsStream.
Please let me know if it's my misunderstanding or a bug.
Looking at the code, I first thought that: if(isNotNull(response.getResponseBody())) { doSomethingWith(response.getResponseBodyAsStream) } would work, as it's just a different representation of the same response body. However, #getResponseBodyAsStream throws a NPE, because ResponseBodyPart#chunk = null. The string-based #getResponseBody returns a valid content, the problem's in #getResponseBodyAsStream. Please let me know if it's my misunderstanding or a bug.
Thank you, -alex yarmula