HTTP & HTTPS Support
Full support for HTTP/1.1 and HTTPS via std.http with TLS verification.
A production-ready Zig library for downloading files with streaming, progress, resume, and retry support.
Add to your build.zig.zon:
zig fetch --save https://github.com/muhammad-fiaz/downloader.zig/archive/refs/tags/0.0.1.tar.gzThen use in your code:
const std = @import("std");
const downloader = @import("downloader");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Simple one-liner download
try downloader.download(
allocator,
"https://example.com/file.zip",
"file.zip"
);
}| Feature | downloader.zig | curl bindings | Custom HTTP |
|---|---|---|---|
| Pure Zig | ✅ | ❌ | ✅ |
| No Dependencies | ✅ | ❌ | ✅ |
| Resume Support | ✅ | Manual | Manual |
| Progress Callback | ✅ | ✅ | Manual |
| Retry Logic | ✅ Built-in | Manual | Manual |
| Smart File Naming | ✅ (1), (2) | ❌ | Manual |
| Thread Safe | ✅ Per-client | Varies | Manual |
| Platform | Architectures | Status |
|---|---|---|
| Windows | x86_64 (64-bit), x86 (32-bit) | ✅ Full support |
| Linux | x86_64, x86, aarch64, arm, riscv64 | ✅ Full support |
| macOS | x86_64 (Intel), aarch64 (Apple Silicon) | ✅ Full support |
| FreeBSD | x86_64 | ✅ Full support |
| Freestanding | Various | ⚠️ Build only |
If you find this library useful, please consider sponsoring!