Create Index with Python and Login

UPDATE. SOLVED by bypassing the RequestsHttpConnection

I am trying to create a index using python

import elasticsearch
from elasticsearch import Elasticsearch,RequestsHttpConnection
es = elasticsearch.Elasticsearch(['192.168.1.226:9200'],
connection_class=RequestsHttpConnection,
verify_certs=False,
http_auth=('admin','password'))
es.indices.create(index=index_name, ignore=400)

This seems to be giving me a bad status line error. I am not really a python guy but this is all I would have to do anyways to get my code working. What am I doing wrong?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.