title: ElasticSearch. Error: 'Content-Type header is missing'
body: <p>Use on AWS ElasticSearch v6.7. For working with ES use library</p>
  <pre><code> &quot;@elastic/elasticsearch&quot;: &quot;^6.8.8&quot;,
  </code></pre>
  <p>For connecting to ES use also library:</p>
  <pre><code>    &quot;aws-elasticsearch-js&quot;: &quot;^1.0.3&quot;,
      
  </code></pre>
  <p>There is no any kind of errors with connection, I checked it by <code>client.cluster.health({})</code>.
  When I send request to Elastic I got this error:</p>
  <pre><code>{
  2022-06-09T13:30:49.589491939Z   meta: {
  2022-06-09T13:30:49.589499754Z     body: { error: 'Content-Type header is missing', status: 406 },
  2022-06-09T13:30:49.589508230Z     statusCode: 406,
  2022-06-09T13:30:49.589516335Z     headers: {
  2022-06-09T13:30:49.589523800Z       date: 'Thu, 09 Jun 2022 13:30:49 GMT',
  2022-06-09T13:30:49.589531895Z       'content-type': 'application/json; charset=UTF-8',
  2022-06-09T13:30:49.589540211Z       'content-length': '55',
  2022-06-09T13:30:49.589548456Z       connection: 'keep-alive',
  2022-06-09T13:30:49.589556442Z       'access-control-allow-origin': '*'
  2022-06-09T13:30:49.589564667Z     },
  2022-06-09T13:30:49.589572222Z     warnings: null,
  2022-06-09T13:30:49.589580247Z     meta: {
  2022-06-09T13:30:49.589587831Z       context: null,
  2022-06-09T13:30:49.589595736Z       request: {
  2022-06-09T13:30:49.589603151Z         params: {
  2022-06-09T13:30:49.589610985Z           method: 'POST',
  2022-06-09T13:30:49.589618951Z           path: '/api-index/_search',
  2022-06-09T13:30:49.589629831Z           body: '&lt;HUGE REQUESRT&gt;',
  2022-06-09T13:30:49.589649769Z           querystring: 'from=0&amp;size=20',
  2022-06-09T13:30:49.589658326Z           headers: {
  2022-06-09T13:30:49.589668395Z             'User-Agent': 'elasticsearch-js/6.8.8 (linux 5.13.0-48-generic-x64; Node.js v16.15.0)',
  2022-06-09T13:30:49.589681500Z             'Content-Type': 'application/json',
  2022-06-09T13:30:49.589703652Z             'Content-Length': '971'
  2022-06-09T13:30:49.589712749Z           },
  2022-06-09T13:30:49.589720554Z           timeout: 30000
  2022-06-09T13:30:49.589728680Z         },
  2022-06-09T13:30:49.589736384Z         options: {
  2022-06-09T13:30:49.589745772Z           headers: { 'Content-Type': 'application/json' },
  2022-06-09T13:30:49.589757514Z           warnings: null
  2022-06-09T13:30:49.589768034Z         },
  2022-06-09T13:30:49.589778705Z         id: 8
  2022-06-09T13:30:49.589789325Z       },
  2022-06-09T13:30:49.589799224Z       name: 'elasticsearch-js',
  2022-06-09T13:30:49.589810044Z       connection: {
  2022-06-09T13:30:49.589820344Z         url: '&lt;AWS_ES_URL&gt;',
  2022-06-09T13:30:49.589831866Z         id: '&lt;AWS_ES_URL&gt;',
  2022-06-09T13:30:49.589843258Z         headers: {},
  2022-06-09T13:30:49.589853748Z         deadCount: 0,
  2022-06-09T13:30:49.589864799Z         resurrectTimeout: 0,
  2022-06-09T13:30:49.589875569Z         _openRequests: 0,
  2022-06-09T13:30:49.589886239Z         status: 'alive',
  2022-06-09T13:30:49.589896579Z         roles: { master: true, data: true, ingest: true, ml: false }
  2022-06-09T13:30:49.589908782Z       },
  2022-06-09T13:30:49.589918832Z       attempts: 0,
  2022-06-09T13:30:49.589928911Z       aborted: false
  2022-06-09T13:30:49.589939952Z     }
  2022-06-09T13:30:49.589950211Z   }
  2022-06-09T13:30:49.589960531Z }
  
  </code></pre>
  <p>From error description I see that main error is <code>Content-Type header is missing</code>. But as them same time I see in request metadata <code>'Content-Type': 'application/json',</code>.
  This problem happened only with ES v6.7. For local development I use v7.2 and it works successfully.
  I don't know why ES engine 6.7 cannot parse this header. Please, help me if you got the same issue.</p>