document.put("_rev", json.get("rev"));
}
private JSONObject getJsonReply(HttpResponse response) throws BenchmarkException {
if (response.isChunked()) {
throw new BenchmarkException("CRUD response is chunked");
}
ChannelBuffer content = response.getContent();
connectionStatistics.receivedJsonBytes(content.readableBytes());
String json = content.toString(CharsetUtil.UTF_8);
try {
return (JSONObject) new JSONParser().parse(json);
} catch (ParseException e) {
throw new BenchmarkException(e);
}
}