# Create index fails using 'PUT' over Java's HttpURLConnection

**URL:** <https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849>\
**Category:** Elasticsearch\
**Created:** [May 13, 2019, 4:32pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849 "2019-05-13T16:32:59Z")\
**Posts on this page:** 8\
**Page:** 2

<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 4, 2019, 6:28pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/21 "2019-06-04T18:28:01Z")

</div>

Not anything I'm aware of but if you share a complete project I can hopefully find some spare time to try it.

---

<div class="post-metadata">

**Author:** ![n2nelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n2nelastic/32/51656_2.png) [@n2nelastic](https://discuss.elastic.co/u/n2nelastic)\
**Post date:** [June 5, 2019, 5:47pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/22 "2019-06-05T17:47:04Z")

</div>

I'm putting Tomcat on the back burner for now, as it simply doesn't seem to work for me, and instead try creating a node.js server to communicate with the Elasticsearch server on 9200.

Any links/tips/examples using node.js will be appreciated David.

---

<div class="post-metadata">

**Author:** ![n2nelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n2nelastic/32/51656_2.png) [@n2nelastic](https://discuss.elastic.co/u/n2nelastic)\
**Post date:** [June 9, 2019, 1:57pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/23 "2019-06-09T13:57:34Z")

</div>

David,

I've been having success using node.js and the node.js client for Elasticsearch.

Most if not all the API calls return a "body" object.

QUESTION: how do I learn how to parse the body objects returned? Can you provide some links to documentation on this subject? I can see in the response that Elastic returns these objects, but so far I'm having to guess how to work with them.

---

<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 9, 2019, 4:02pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/24 "2019-06-09T16:02:15Z")

</div>

May be this could help?

> **[elastic/elasticsearch](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec)**
>
> Open Source, Distributed, RESTful Search Engine. Contribute to elastic/elasticsearch development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![n2nelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n2nelastic/32/51656_2.png) [@n2nelastic](https://discuss.elastic.co/u/n2nelastic)\
**Post date:** [June 20, 2019, 3:51pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/25 "2019-06-20T15:51:20Z")

</div>

Thanks again David.

Is there a simple, working example of autocomplete using calls in Kibana?

I found one promising example in a search, but it doesn't work, and I can't find others.

Should I open a new topic on this?

---

<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 20, 2019, 4:04pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/26 "2019-06-20T16:04:04Z")

</div>

Yes. That'd be better.

---

<div class="post-metadata">

**Author:** ![n2nelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n2nelastic/32/51656_2.png) [@n2nelastic](https://discuss.elastic.co/u/n2nelastic)\
**Post date:** [June 20, 2019, 4:17pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/27 "2019-06-20T16:17:54Z")

</div>

I'll do that.

This topic then can be closed if that seems appropriate, and again thanks for all your help.

---

<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 18, 2019, 4:17pm UTC](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849/28 "2019-07-18T16:17:56Z")

</div>

Closed on July 18, 2019, 4:17pm UTC

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

[Previous page](https://discuss.elastic.co/t/create-index-fails-using-put-over-javas-httpurlconnection/180849.md?page=1)
