stream = httpMethod.getResponseBodyAsStream();
} else {
body = httpMethod.getResponseBodyAsString();
}
return new DefaultHttpResponse(bucket, key, status, headers, body, stream, httpMethod);
} catch (IOException e) {
return toss(new RiakIORuntimeException(e));
} finally {
if (!streamResponse) {
httpMethod.releaseConnection();