# Java RestClient sending gzip update

**URL:** <https://discuss.elastic.co/t/java-restclient-sending-gzip-update/132220>\
**Category:** Elasticsearch\
**Created:** [May 16, 2018, 9:32pm UTC](https://discuss.elastic.co/t/java-restclient-sending-gzip-update/132220 "2018-05-16T21:32:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![surabaya](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@surabaya](https://discuss.elastic.co/u/surabaya)\
**Post date:** [May 16, 2018, 9:32pm UTC](https://discuss.elastic.co/t/java-restclient-sending-gzip-update/132220/1 "2018-05-16T21:32:18Z")

</div>

Is there a way to send gzipped document update to ES using the low-level Java RestClient?

I intend to send a `_bulk` update using `RestClient` this way:

```auto
restClient.performRequest("POST", "endpoint/_bulk", emptyMap(),
    new GzipCompressingEntity(new NStringEntity("<document>", "application/json")));

```

but I'm getting the following error:

```auto
java.lang.UnsupportedOperationException: null
! at org.apache.http.client.entity.GzipCompressingEntity.getContent(GzipCompressingEntity.java:100)

```

---

<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:** [June 13, 2018, 9:32pm UTC](https://discuss.elastic.co/t/java-restclient-sending-gzip-update/132220/2 "2018-06-13T21:32:19Z")

</div>

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