# Streaming response with \`cohttp\_eio\`?

**URL:** <https://discuss.ocaml.org/t/streaming-response-with-cohttp-eio/15236>\
**Category:** Learning\
**Created:** [September 3, 2024, 7:32pm UTC](https://discuss.ocaml.org/t/streaming-response-with-cohttp-eio/15236 "2024-09-03T19:32:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enetsee](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/enetsee/32/1041_2.png) [@enetsee](https://discuss.ocaml.org/u/enetsee)\
**Post date:** [September 3, 2024, 7:32pm UTC](https://discuss.ocaml.org/t/streaming-response-with-cohttp-eio/15236/1 "2024-09-03T19:32:01Z")

</div>

Sorry for the noob question - is it possible to process a chunked response with `cohttp`? I’d like to do something like [this `h2` example](https://github.com/anmonteiro/ocaml-h2?tab=readme-ov-file#a-client-example)

Thanks!

---

<div class="post-metadata">

**Author:** ![dx3mod](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dx3mod/32/6740_2.png) [@dx3mod](https://discuss.ocaml.org/u/dx3mod)\
**Post date:** [September 4, 2024, 7:57am UTC](https://discuss.ocaml.org/t/streaming-response-with-cohttp-eio/15236/2 "2024-09-04T07:57:34Z")

</div>

Yes, you can do that. The [`Cohttp_eio.Body.t`](https://mirage.github.io/ocaml-cohttp/cohttp-eio/Cohttp_eio/Body/index.html) is the `Eio.Flow.source_ty Eio.Resource.t` type for streaming a resource.

See an [example](https://github.com/mirage/ocaml-cohttp/blob/master/cohttp-eio/examples/client1.ml).
