Код: Выделить всё
data = {
"xxx" : "status",
"value" : "incomplete"
}
headers = {'Content-type': 'application/json'}
response = requests.post(f'http://localhost:9200/my_index', data=json.dumps(data))
response = requests.post(f'http://localhost:9200/my_index', data=json.dumps(data), headers=headers)
response = requests.post(f'http://localhost:9200/my_index', json=data)
response = requests.post(f'http://localhost:9200/my_index', json=data, headers=headers)
ES определенно работает, я могу использовать Postman и Curl в CLI.
Код: Выделить всё
requests.putКод: Выделить всё
response = requests.put(f'http://localhost:9200/my_index/_doc/2', data=json.dumps(data), headers=headers)
ОС — Linux Mint 20. ES — 7.16. 3.
Подробнее здесь: https://stackoverflow.com/questions/709 ... g-requests