I'm using elasticsearch-java-client 7.17.4 to make my a count request to AWS Elasticsearch server like this follow code
elasticsearchClient.count(s -> s
.index("my-index")
).count();
However the follow exception was happening
Caused by: org.elasticsearch.client.ResponseException: method [POST],
host [https://my-host], URI [/my-index/_count], status line [HTTP/1.1 406 Not Acceptable]
{"error":"Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported","status":406}
Looking _count api at elasticsearch RestAPI reference sound like strange because the http method is GET, but elasticsearch-java make a request with POST.
Somebody had this issue?