private Map<String, Object> parseBody(RestResponse response) throws IOException { return XContentFactory.xContent(XContentType.JSON) .createParser( response.getBody().array(), response.getBody().arrayOffset(), response.getBody().remaining()) .map(); }