trying to do a PUT using curl and python subprocess, however, I am unable to set the content type for my request.
import subprocess
item = '{"title": "Copy", "id": "1mglMSA_wU", "type": "document", "parentId": "1WtlhD7a", "modifiedTime": "2019-01-16T21:33:36.631Z", "createdTime": "2019-01-16T21:29:26.327Z", "shared": "True"}'
cmd = f'curl -H "Content-Type: application/json" -X PUT localhost:9200/ax/_doc/1?pretty -d\'{item}\''
res = subprocess.Popen(f'ssh {user}@{host} {cmd}', shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
print(res)
I keep getting the following error:
{
"error" : "Content-Type header [] is not supported",
"status" : 406
}