# Http.content\_type.required: false by default then why asking for content type

**URL:** <https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710>\
**Category:** Elasticsearch\
**Created:** [July 4, 2017, 5:04am UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710 "2017-07-04T05:04:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilip\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_kumar/32/15459_2.png) [@Dilip\_Kumar](https://discuss.elastic.co/u/Dilip_Kumar)\
**Post date:** [July 4, 2017, 5:04am UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/1 "2017-07-04T05:04:31Z")

</div>

Hi All,  
If http.content\_type.required: false by default then why in log file saying "Content type detection for rest requests is deprecated."

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [July 4, 2017, 10:50am UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/2 "2017-07-04T10:50:59Z")

</div>

Because in 6.0.0, `http.content_type.required` will no longer be configurable and will act as if it defaults to `true`. This means that HTTP requests with a body will require the `Content-Type` header to be set.

---

<div class="post-metadata">

**Author:** ![Dilip\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_kumar/32/15459_2.png) [@Dilip\_Kumar](https://discuss.elastic.co/u/Dilip_Kumar)\
**Post date:** [July 7, 2017, 5:36am UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/3 "2017-07-07T05:36:00Z")

</div>

Thank you jasontedor, but why i am getting warning in log file even i have added content type . Please send me one example..

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [July 7, 2017, 3:03pm UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/4 "2017-07-07T15:03:10Z")

</div>

I think you must have a request where you not sending the `Content-Type` otherwise you would not see this log message.

---

<div class="post-metadata">

**Author:** ![Dilip\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_kumar/32/15459_2.png) [@Dilip\_Kumar](https://discuss.elastic.co/u/Dilip_Kumar)\
**Post date:** [July 19, 2017, 9:11am UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/5 "2017-07-19T09:11:12Z")

</div>

Thank you reply , i have added content type but still getting message content type should be add.

please share curl example with content type...

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [July 19, 2017, 10:29pm UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/6 "2017-07-19T22:29:14Z")

</div>

> [@Dilip\_Kumar](#):
>
> Thank you reply , i have added content type but still getting message content type should be add.

Please provide a reproduction.

> [@Dilip\_Kumar](#):
>
> please share curl example with content type...

You just add the header:

```auto
curl -H "Content-Type: application/json" ...

```

---

<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:** [August 16, 2017, 10:29pm UTC](https://discuss.elastic.co/t/http-content-type-required-false-by-default-then-why-asking-for-content-type/91710/7 "2017-08-16T22:29:37Z")

</div>

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