Skip to content

Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported #1933

@ctrl-Felix

Description

@ctrl-Felix

Describe the feature:

Elasticsearch version (bin/elasticsearch --version): 6.4.2

elasticsearch-py version (elasticsearch.__versionstr__): 8.1.0

Description of the problem including expected versus actual behavior:

I am using the basic example from the docs but I keep getting the error elasticsearch.ApiError: ApiError(406, 'Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported', 'Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported')

Steps to reproduce:


from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch('http://localhost:9200')


doc = {
    'author': 'author_name',
    'text': 'Interensting content...',
    'timestamp': datetime.now(),
}
resp = es.index(index="test-index", id="1", document=doc)
print(resp['result'])
es.indices.refresh(index="test-index")


resp = es.get(index="test-index", id=1)
print(resp['_source'])


doc = {
    'author': 'author_name',
    'text': 'Interensting content...',
    'timestamp': datetime.now(),
}


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions