# Extremely Simple Java Request

**URL:** <https://discuss.elastic.co/t/extremely-simple-java-request/18082>\
**Category:** Elasticsearch\
**Created:** [June 12, 2014, 11:23pm UTC](https://discuss.elastic.co/t/extremely-simple-java-request/18082 "2014-06-12T23:23:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smonasco\_2](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smonasco\_2](https://discuss.elastic.co/u/smonasco_2)\
**Post date:** [June 12, 2014, 11:23pm UTC](https://discuss.elastic.co/t/extremely-simple-java-request/18082/1 "2014-06-12T23:23:00Z")

</div>

I've been through the API documentation and the elasticsearch source code.

I'm looking to create a service that when given a list of (URL path, JSON  
path, metric type) will take the value found at the JSON path from the JSON  
returned from the URL in my cluster and put it into our metrics system.

I'm trying to find something really simple in the Java space that will give  
me a JSON object of some variety or a response object I can call  
.toXContent on when I pass it the URL.

Not sure if I'm explaining this well, but something like:

Request request = new SimpleRequest(url);  
Response response = client.get(request).actionGet();  
XContentBuilder responseContent = XContentFactory.jsonBuilder();  
response.toXContent(responseContent, null);

If I need to build it myself that's ok. I'd just like to know it's not  
built and maybe have a pointer or two.

--Shannon Monasco

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0b62a618-8812-450b-9160-e2763c02ee0b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b62a618-8812-450b-9160-e2763c02ee0b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![smonasco\_2](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smonasco\_2](https://discuss.elastic.co/u/smonasco_2)\
**Post date:** [June 15, 2014, 2:16am UTC](https://discuss.elastic.co/t/extremely-simple-java-request/18082/2 "2014-06-15T02:16:32Z")

</div>

I rolled my own.

On Thursday, June 12, 2014 5:23:00 PM UTC-6, smonasco wrote:

> I've been through the API documentation and the elasticsearch source code.
> 
> I'm looking to create a service that when given a list of (URL path, JSON  
> path, metric type) will take the value found at the JSON path from the JSON  
> returned from the URL in my cluster and put it into our metrics system.
> 
> I'm trying to find something really simple in the Java space that will  
> give me a JSON object of some variety or a response object I can call  
> .toXContent on when I pass it the URL.
> 
> Not sure if I'm explaining this well, but something like:
> 
> Request request = new SimpleRequest(url);  
> Response response = client.get(request).actionGet();  
> XContentBuilder responseContent = XContentFactory.jsonBuilder();  
> response.toXContent(responseContent, null);
> 
> If I need to build it myself that's ok. I'd just like to know it's not  
> built and maybe have a pointer or two.
> 
> --Shannon Monasco

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8dcd8d74-453d-4578-9f1b-1250ceaa7594%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8dcd8d74-453d-4578-9f1b-1250ceaa7594%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:22am UTC](https://discuss.elastic.co/t/extremely-simple-java-request/18082/3 "2017-07-06T01:22:30Z")

</div>

Closed on July 6, 2017, 1:22am UTC


