# Ergonomic http lib in zig

**URL:** <https://ziggit.dev/t/ergonomic-http-lib-in-zig/17733>\
**Category:** Showcase\
**Created:** [September 27, 2026, 4:52pm UTC](https://ziggit.dev/t/ergonomic-http-lib-in-zig/17733 "2026-09-27T16:52:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zendrx](https://ziggit.dev/user_avatar/ziggit.dev/zendrx/32/9385_2.png) [@zendrx](https://ziggit.dev/u/zendrx)\
**Post date:** [September 27, 2026, 4:52pm UTC](https://ziggit.dev/t/ergonomic-http-lib-in-zig/17733/1 "2026-09-27T16:52:51Z")

</div>

# crestz:

* * *

_cestz is more like making server side request its my first real zig projects [GitHub - zendrx/crestz · GitHub](https://github.com/zendrx/crestz)_

### Supported Zig versions

zig-0.16.0

---

<div class="post-metadata">

**Author:** ![lalinsky](https://ziggit.dev/user_avatar/ziggit.dev/lalinsky/32/3720_2.png) [@lalinsky](https://ziggit.dev/u/lalinsky)\
**Post date:** [September 27, 2026, 5:32pm UTC](https://ziggit.dev/t/ergonomic-http-lib-in-zig/17733/2 "2026-09-27T17:32:54Z")

</div>

Nice job.

I see that you are allocating the response body multiple times. You can save one allocation and one copy by taking taking the buffer from `std.Io.Writer.Allocating` without re-allocating it, it’s just a slice allocated using the provided allocator. Or just store the entire `std.Io.Writer.Allocating` inside `response`, if you want to avoid dealing the internals. GPA allocations in Zig are not exactly fast, so it’s best to avoid them if you can.

Also, it’s really not ideal to create `std.http.Client` per request. It creates a connection pool, so if you do multiple reqests to the same server, you could likely reuse them.
