# Any way to get String Response from performRequest call?

**URL:** <https://discuss.elastic.co/t/any-way-to-get-string-response-from-performrequest-call/201735>\
**Category:** Elasticsearch\
**Created:** [October 1, 2019, 6:39am UTC](https://discuss.elastic.co/t/any-way-to-get-string-response-from-performrequest-call/201735 "2019-10-01T06:39:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreekanth](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sreekanth](https://discuss.elastic.co/u/sreekanth)\
**Post date:** [October 1, 2019, 6:39am UTC](https://discuss.elastic.co/t/any-way-to-get-string-response-from-performrequest-call/201735/1 "2019-10-01T06:39:48Z")

</div>

Right now are using below call and then converting response to String as below.

Response response = restClient.performRequest(new Request("GET", "/"));  
String responseBody = EntityUtils.toString(response.getEntity());

Is there any way to get the response from performRequest directly as String?

In our case, we have huge time spent on this toString() which we want to avoid.  
Any clues on this will be greatly appreciated.

---

<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:** [October 29, 2019, 6:39am UTC](https://discuss.elastic.co/t/any-way-to-get-string-response-from-performrequest-call/201735/2 "2019-10-29T06:39:53Z")

</div>

Closed on October 29, 2019, 6:39am UTC

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