[Solved] Python Connect to ES Error: elasticsearch.ApiError: ApiError(406

elasticsearch.ApiError: ApiError(406, ‘Content-Type header [application/vnd.elasticsearch+x-ndjson; compatible-with=8] is not supported’, ‘Content-Type header [application/vnd.elasticsearch+x-ndjson; compatible-with=8] is not supported’)

 

Solution:

1. You need to keep the elasticsearch installation version consistent with the python elasticsearch third-party library (module) version to solve
view the server installation version


view the third-party library (module) version

2 If not, upgrade or downgrade the third-party library (module) to achieve consistency

Read More: