@SuppressWarnings({"unchecked"})
public HttpClientResponse request(String method, String path, Map<String, Object> data) {
ObjectMapper mapper = new ObjectMapper();
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
mapper.writeValue(out, data);
} catch (IOException e) {
throw new ElasticsearchException("", e);
}
return request(method, path, out.toByteArray());
}