# WARN Content type detection for rest requests is deprecated

**URL:** <https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269>\
**Category:** Elasticsearch\
**Created:** [June 21, 2017, 11:07am UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269 "2017-06-21T11:07:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)\
**Post date:** [June 21, 2017, 11:07am UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/1 "2017-06-21T11:07:01Z")

</div>

I'm seeing a lot of these warnings in our logs, can anyone tell me what they are, and where they are coming from?

> [2017-06-21T09:36:18,650][WARN][org.elasticsearch.deprecation.rest.RestController] Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2017, 12:47pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/2 "2017-06-21T12:47:43Z")

</div>

You need to specify the content type.

How are you inserting documents in elasticsearch?

---

<div class="post-metadata">

**Author:** ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)\
**Post date:** [June 21, 2017, 12:48pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/3 "2017-06-21T12:48:45Z")

</div>

We're using the PHP vendor v5.2.0

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2017, 1:02pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/4 "2017-06-21T13:02:48Z")

</div>

Upgrade. It might be fixed now.

---

<div class="post-metadata">

**Author:** ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)\
**Post date:** [June 21, 2017, 1:04pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/5 "2017-06-21T13:04:19Z")

</div>

v5.2.0 is the latest release of the vendor..., or do you mean upgrade the cluster?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2017, 1:07pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/6 "2017-06-21T13:07:00Z")

</div>

No I meant update the client.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2017, 1:19pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/7 "2017-06-21T13:19:38Z")

</div>

Why do you mean by PHP Vendor BTW?

---

<div class="post-metadata">

**Author:** ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)\
**Post date:** [June 21, 2017, 1:28pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/8 "2017-06-21T13:28:53Z")

</div>

> **[elastic/elasticsearch-php](https://github.com/elastic/elasticsearch-php/releases)**
>
> elasticsearch-php - Official PHP low-level client for Elasticsearch.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2017, 4:32pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/9 "2017-06-21T16:32:42Z")

</div>

I think @polyfractal can help here.  
I don't see an issue in the repo related to this.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [June 21, 2017, 4:53pm UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/10 "2017-06-21T16:53:38Z")

</div>

Hm, the client should be setting the content-type correctly, see here: [https://github.com/elastic/elasticsearch-php/blob/master/src/Elasticsearch/ClientBuilder.php#L480](https://github.com/elastic/elasticsearch-php/blob/master/src/Elasticsearch/ClientBuilder.php#L480)

@barry1 can you open an issue at the Elasticsearch-PHP github repo with your details? We can work through your problem there

---

<div class="post-metadata">

**Author:** ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)\
**Post date:** [June 22, 2017, 7:58am UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/11 "2017-06-22T07:58:51Z")

</div>

@polyfractal done that:

> <https://github.com/elastic/elasticsearch-php/issues/593>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 20, 2017, 7:59am UTC](https://discuss.elastic.co/t/warn-content-type-detection-for-rest-requests-is-deprecated/90269/12 "2017-07-20T07:59:00Z")

</div>

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