# Issue with HighLevelRestClient with the host = xyz.com:8080/elasticsearch

**URL:** <https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 6:32am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384 "2019-06-19T06:32:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://discuss.elastic.co/u/tanvi)\
**Post date:** [June 19, 2019, 6:32am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/1 "2019-06-19T06:32:32Z")

</div>

If i'm using [xyz.com](http://xyz.com) as the host with HighLevelRestClient, it says unable to parse response body .  
If I'm using [xyz.com:8080/elasticsearch](http://xyz.com:8080/elasticsearch) as the host with HighLevelRestClient, it says UnknownHostException.

I'm not sure what i'm missing here.

---

<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 19, 2019, 8:48am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/2 "2019-06-19T08:48:13Z")

</div>

What is running on port 8080?

---

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://discuss.elastic.co/u/tanvi)\
**Post date:** [June 19, 2019, 9:21am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/3 "2019-06-19T09:21:59Z")

</div>

it is a kibana host for elasticsearch. I've tried using TransportClient in place of HighLevelRestClient using [xyz.com](http://xyz.com) bit it gives the exception : cannot find any configured nodes.  
I think the issue here is how to give this entire url host in the request?

---

<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 19, 2019, 11:05am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/4 "2019-06-19T11:05:30Z")

</div>

Sorry but I don't understand.

Kibana runs by default on 5601.  
Elasticsearch runs by default on 9200.

What is supposed to run on 8080 or 80?  
What are you trying to do here?

---

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://discuss.elastic.co/u/tanvi)\
**Post date:** [June 20, 2019, 3:39am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/5 "2019-06-20T03:39:42Z")

</div>

I'll try to explain my issue clearly  
I have given a host from the client which says like : [xyz.com:8080/elasticsearch](http://xyz.com:8080/elasticsearch)

If I only use "[xyz.com](http://xyz.com)", it gives me ElasticSearchException "Invalid request payload JSON format" & that is true also because I havn't specified "/elasticsearch  
" anywhere.  
But if I give the host as complete URL i.e. [xyz.com:8080/elasticsearch](http://xyz.com:8080/elasticsearch) (which works fine with POSTMAN) , it gives unknown host exception. ☹

How can I specify the part of the URL i.e. "/elasticsearch" which is after the host in my Java spring code? I  
PS. I'm using HighLevelRestClient

---

<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, 5:14am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/6 "2019-06-20T05:14:03Z")

</div>

Do you have a reverse proxy or something similar which translate localhost:9200 to [xyz.com:8080/elasticsearch](http://xyz.com:8080/elasticsearch)?

What is the output of:

```
curl xyz.com:8080/elasticsearch
```

---

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://discuss.elastic.co/u/tanvi)\
**Post date:** [June 20, 2019, 5:22am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/7 "2019-06-20T05:22:58Z")

</div>

I don't know how to do curl, but on hitting it on browser, I get the response with **tagline**"You Know, for Search"

---

<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, 5:40am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/8 "2019-06-20T05:40:59Z")

</div>

How do you start elasticsearch? What are the logs?

---

<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, 5:41am UTC](https://discuss.elastic.co/t/issue-with-highlevelrestclient-with-the-host-xyz-com-8080-elasticsearch/186384/9 "2019-07-18T05:41:52Z")

</div>

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