【发布时间】:2019-07-20 05:35:45
【问题描述】:
我正在使用库 aioes,当我尝试执行此脚本时:
from aioes import Elasticsearch
import asyncio
@asyncio.coroutine
def check():
host = 'localhost'
port = 1234
es = Elasticsearch(['{host}:{port}'.format(host=host, port=port)])
answer = yield from es.search(index="test-index", body={})
print(answer)
loop = asyncio.get_event_loop()
loop.run_until_complete(check())
我收到此错误:aioes.exception.TransportError: TransportError(406, '{"error":"Content-Type header [application/octet-stream] is not supported","status":406}')
我尝试过上网,但没有找到任何解决方案。我哪里错了?
【问题讨论】:
标签: python elasticsearch content-type