ES 5.6 elasticsearch_deprecation.log WARN

Hello.
Tell me the probable cause of these records?

[2018-04-26T15:40:08,206][WARN ][o.e.d.r.RestController ] Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.
[2018-04-26T15:40:08,207][WARN ][o.e.d.r.RestController ] Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.
[2018-04-26T15:40:08,208][WARN ][o.e.d.r.RestController ] Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.
[2018-04-26T15:40:08,209][WARN ][o.e.d.r.RestController ] Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.
...

You are calling elasticsearch with a body without specifying the Content-Type.

I specify so, but still there is a WARN

    <?php
    curl_setopt($ci, CURLOPT_URL, 'http://127.0.0.1:9200/index/type/');
    curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ci, CURLOPT_FORBID_REUSE, 0);
    curl_setopt($ci, CURLOPT_HTTPHEADER, ['Content-Type: application/json; charset=UTF-8']);
    curl_setopt($ci, CURLOPT_POST, true);
    curl_setopt($ci, CURLOPT_POSTFIELDS, json_encode($data_query, JSON_UNESCAPED_UNICODE));
    ...
    ?>

I don't know. What happens if you do that with curl instead of PHP?

The error went away. This was due to running scripts.
Thank you. The problem is solved.

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