# Converting curl commands to java client api

**URL:** <https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971>\
**Category:** Elasticsearch\
**Created:** [December 6, 2012, 11:31am UTC](https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971 "2012-12-06T11:31:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![divyanshu\_das](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@divyanshu\_das](https://discuss.elastic.co/u/divyanshu_das)\
**Post date:** [December 6, 2012, 11:31am UTC](https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971/1 "2012-12-06T11:31:29Z")

</div>

In elasticsearch, while using "curl", everything works like a charm.  
But when we try to do it with java api, there is a lack of documentation.

java api in elasticsearch has very few examples:-  
[http://www.elasticsearch.org/guide/reference/java-api/client.html](http://www.elasticsearch.org/guide/reference/java-api/client.html)

However, for curl, there are hundreds of examples.

Is there any other link which provides java commands equivalent to curl  
commands?

--

---

<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:** [December 6, 2012, 11:26pm UTC](https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971/2 "2012-12-06T23:26:07Z")

</div>

Not really what you are asking for, but you could give a look at:

> **[elasticsearchfr/hands-on](https://github.com/elasticsearchfr/hands-on/tree/answers)**
>
> hands-on - Hands On Lab

  

> **[elasticsearchfr/elasticsearch-java-tests](https://github.com/elasticsearchfr/elasticsearch-java-tests)**
>
> elasticsearch-java-tests - Elasticsearch Java Tests

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 déc. 2012 à 12:31, divyanshu das [divyanshu.das@gmail.com](mailto:divyanshu.das@gmail.com) a écrit :

In elasticsearch, while using "curl", everything works like a charm.  
But when we try to do it with java api, there is a lack of documentation.

java api in elasticsearch has very few examples:-  
[http://www.elasticsearch.org/guide/reference/java-api/client.html](http://www.elasticsearch.org/guide/reference/java-api/client.html)

However, for curl, there are hundreds of examples.

Is there any other link which provides java commands equivalent to curl commands?

--

--

---

<div class="post-metadata">

**Author:** ![ferhatsb](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@ferhatsb](https://discuss.elastic.co/u/ferhatsb)\
**Post date:** [December 7, 2012, 8:25am UTC](https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971/3 "2012-12-07T08:25:18Z")

</div>

🙂 That is not also a true answer to your question as well but if you are  
fine by http rest try Jest, [GitHub - searchbox-io/Jest: Elasticsearch Java Rest Client.](https://github.com/searchbox-io/Jest)

On Thursday, December 6, 2012 1:31:29 PM UTC+2, divyanshu das wrote:

> In elasticsearch, while using "curl", everything works like a charm.  
> But when we try to do it with java api, there is a lack of documentation.
> 
> java api in elasticsearch has very few examples:-  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> 
> However, for curl, there are hundreds of examples.
> 
> Is there any other link which provides java commands equivalent to curl  
> commands?

--

---

<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 6, 2017, 3:00am UTC](https://discuss.elastic.co/t/converting-curl-commands-to-java-client-api/9971/4 "2017-07-06T03:00:55Z")

</div>


