Skip to content

Invalid media-type value on headers [Content-Type, Accept] on all calls in v9.0.0 #2923

Closed
@moh3nhadavi

Description

@moh3nhadavi

Hello,
I define my client as follows:

self.es = AsyncElasticsearch(
    cloud_id=config["cloud_id"],
    basic_auth=(
        config["username"],
        config["password"],
    ),
    http_compress=True,
    request_timeout=60,
)

Since I have installed the v9.0.0 version of Elasticsearch, I get

BadRequestError(400, 'media_type_header_exception', 'Invalid media-type value on headers [Content-Type, Accept]')

on all the requests. I also tried to add

{
    "Accept": "application/json",
    "Content-Type": "application/json"
}

in the header. But it didn't work.

Does anyone have any idea how to fix this bug?

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