# HttpClientZioBackend limit response body length

**URL:** <https://softwaremill.community/t/httpclientziobackend-limit-response-body-length/45>\
**Category:** sttp client\
**Created:** [December 20, 2022, 7:45am UTC](https://softwaremill.community/t/httpclientziobackend-limit-response-body-length/45 "2022-12-20T07:45:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![codingskynet](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/codingskynet/32/45_2.png) [@codingskynet](https://softwaremill.community/u/codingskynet)\
**Post date:** [December 20, 2022, 7:45am UTC](https://softwaremill.community/t/httpclientziobackend-limit-response-body-length/45/1 "2022-12-20T07:45:17Z")

</div>

Hello, my team are developing with SttpClient for server.

We implemented the webhook send using `SttpBackend[Task, ZioStreams with WebSockets]`. By the way, we are concerned with the webhook can arise out of memory due to the huge size of webhook response body. I searched and found that the backend for akka http has `akka.http.parsing.max-content-length`. Does similar options for zio backend exist? Or, how can we limit the client response body size?

---

<div class="post-metadata">

**Author:** ![adamw](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/adamw/32/28_2.png) [@adamw](https://softwaremill.community/u/adamw)\
**Post date:** [December 20, 2022, 8:35am UTC](https://softwaremill.community/t/httpclientziobackend-limit-response-body-length/45/2 "2022-12-20T08:35:22Z")

</div>

I assume you are using the `HttpClientZioBackend` as described [here](https://sttp.softwaremill.com/en/latest/backends/zio.html)?

If so, it seems there’s no way provided by `HttpClient` to limit the body size. [SO suggests](https://stackoverflow.com/questions/9965911/how-to-limit-httpclient-response-length) stopping reading from the `InputStream` after reaching the limit. However, when integrating with ZIO, we use the reactive streams variant, so that would need some support on our side.

Can you [add an issue](https://github.com/softwaremill/sttp/issues), with a feature request? Thanks!
