I understand that in elasticsearch 6 the content type header is mandatory. I get a nice exception when omitting it when connecting using the low level rest client.
{"error":"Content-Type header [text/plain; charset=ISO-8859-1] is not supported","status":406}
Is there a good reason not to include it by default? I know I can do this myself when creating the client using the default headers, but I would like to understand why this is not the default out of the box as almost all request will need it
Sometimes if you want to use something like _bulk you are probably going to use another content-type than application/json. That's probably why.
Some people also want to provide yaml instead of json.
Note that the High Level client hides all that "complexity".
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.