# Index/Search API's supported content type

**URL:** <https://discuss.elastic.co/t/index-search-apis-supported-content-type/146219>\
**Category:** Elasticsearch\
**Created:** [August 27, 2018, 6:00pm UTC](https://discuss.elastic.co/t/index-search-apis-supported-content-type/146219 "2018-08-27T18:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmnarloch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmnarloch/32/34854_2.png) [@jmnarloch](https://discuss.elastic.co/u/jmnarloch)\
**Post date:** [August 27, 2018, 6:00pm UTC](https://discuss.elastic.co/t/index-search-apis-supported-content-type/146219/1 "2018-08-27T18:00:56Z")

</div>

Hi,

I was hoping to clarify after reading the question: [Elasticsearch and Smile encoded JSON](https://discuss.elastic.co/t/elasticsearch-and-smile-encoded-json/17796) what are the exact "Content-Type" values handled/supported by Elasticsearch Index/Search endpoints in Elasticsearch 6.x?

I assume that both "application/json" and "application/smile" will work fine? Will this also apply of specifying "Accept" header when retrieving a document or doing a search?

A fallow up questions is will Elasticsearch will do automatically conversion for the types? If I will insert a smile encoded document will I be able to retrieve a JSON when doing a query? (this isn't a use case that I wish to pursue, I just would like to know what will be the limitations of choosing one format over another).

The Rest HighLevel client, [SearchHit](https://github.com/elastic/elasticsearch/blob/a3b272966d8de964251186cb06967e5ec7e66f89/server/src/main/java/org/elasticsearch/search/SearchHit.java#L234) types does not appear to expose the source directly as byte array and the getSourceAsString method appears to assume the content type to be in 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:** [September 24, 2018, 6:04pm UTC](https://discuss.elastic.co/t/index-search-apis-supported-content-type/146219/2 "2018-09-24T18:04:33Z")

</div>

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