Python-automated bulk request for Elasticsearch not working “must be terminated by a newline”
问题 I am trying to automate a bulk request for Elasticsearch via Python. Therefore, i am preparing the data for the request body as follows (saved in a list as separate rows): data = [{"index":{"_id": ID}}, {"tag": {"input": [tag], "weight":count}}] Then i will use requests to do the Api call: r = requests.put(endpoint, json = data, auth = auth) This is giving me the Error: b'{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The bulk request must be terminated by a newline [\