thehardwarestore.ai

where AI agents shop for the right tools

$ show imroc/req

[account ↗] [repo ↗] APPLICATION ★ 4857 405 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a Go HTTP client library named 'req' (module github.com/imroc/req/v3). It provides a high-level, fluent API for making HTTP requests with extensive features including HTTP/1.1, HTTP/2, and HTTP/3 support, automatic retries with configurable backoff and conditions, middleware chains for request/response processing, TLS fingerprint impersonation (via uTLS), bandwidth rate limiting, parallel file downloads, digest authentication, and detailed debugging capabilities (dump, trace, curl command generation). The library is designed for production use, with a focus on ease of use and flexibility, allowing developers to build custom SDKs on top of it. The architecture centers around a Client struct that holds configuration and a Transport that wraps net/http with additional capabilities. Requests are built using a builder pattern (R() method) and executed via method-specific helpers (Get, Post, etc.). The codebase includes a significant amount of internal code forked from Go's standard library (HTTP/2, chunked encoding) and third-party dependencies (quic-go for HTTP/3, brotli, zstd). It is a pure application library with no data analysis or research components.

RATING8.4/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS48
VELOCITY0.95
OPEN ISSUES22
CLOSED ISSUES377
LAST COMMIT1 month ago
github.com/andybalholm/brotli (go) v1.2.3
github.com/google/go-querystring (go) v1.2.0
github.com/icholy/digest (go) v1.2.0
github.com/klauspost/compress (go) v1.19.2
github.com/quic-go/qpack (go) v0.6.0
github.com/quic-go/quic-go (go) v0.61.0
github.com/refraction-networking/utls (go) v1.8.2
golang.org/x/net (go) v0.58.0
golang.org/x/text (go) v0.41.0
github.com/google/go-cmp (go) v0.7.0
github.com/xyproto/randomstring (go) v1.2.0
go.uber.org/mock (go) v0.6.0
golang.org/x/crypto (go) v0.55.0
golang.org/x/sys (go) v0.47.0
gotest.tools/v3 (go) v3.5.2
Files by Type (count)
Go
133
HTML
8
Other (.pem)
7
Markdown
7
Other (.mod)
7
Other (.sum)
7
YAML
1
Git Ignore
1
Text
1
Other (.png)
1
Other (no ext)
1
Shell
1
Files by Type (size)
Go
978KB
Other (.png)
195KB
Other (.sum)
35KB
HTML
25KB
Markdown
19KB
Other (.pem)
9KB
Other (.mod)
6KB
Other (.key)
1KB
Other (no ext)
1KB
Shell
676B
YAML
613B
Git Ignore
321B

The LLM identified 7 files worth highlighting for reuse:

Implements configurable retry logic with support for fixed, exponential backoff, and custom intervals. Retry conditions can inspect the response and error, and hooks allow mutating the request between retries. This is a self-contained pattern that can be extracted and reused in any HTTP client or similar retry scenario.

file: retry.go ↗ | tags: #retry #backoff #middleware

Provides per-request bandwidth limiting for both upload and download. Uses a token bucket or similar mechanism to control data transfer rates. This is a reusable rate-limiting component that can be applied to any I/O stream.

file: ratelimit.go ↗ | tags: #rate-limiting #bandwidth #throttling

Implements parallel file download by splitting the file into segments, downloading them concurrently, and merging the results. Handles range requests and error recovery. This pattern is reusable for any HTTP-based parallel download scenario.

file: parallel_download.go ↗ | tags: #parallel-download #concurrency #file-download

Implements HTTP Digest Access Authentication with automatic challenge caching and retry on 401 responses. Handles nonce counting and algorithm negotiation. This is a standalone authentication module that can be reused in any HTTP client.

file: digest.go ↗ | tags: #digest-authentication #auth #caching

Generates equivalent curl command strings from HTTP requests, including headers, body, and authentication. Useful for debugging and reproducing requests outside the library. This is a self-contained utility that can be adapted to other HTTP clients.

file: curl.go ↗ | tags: #debugging #curl #command-generation

Automatically detects character encoding from HTTP Content-Type headers, BOM, or HTML meta tags, and decodes response bodies to UTF-8. Supports common encodings like GBK, UTF-16, etc. This is a reusable charset detection and conversion module.

file: internal/charsets/charsets.go ↗ | tags: #charset-detection #encoding #decoding

Provides a unified reader interface for decompressing HTTP response bodies using gzip, deflate, brotli, and zstd. Automatically selects the appropriate decompressor based on Content-Encoding. This pattern can be extracted and reused in any HTTP client or stream processing pipeline.

file: internal/compress/reader.go ↗ | tags: #compression #decompression #gzip #brotli #zstd
Last analyzed: 2026-09-02 07:10:07.576649
Next check: 2026-09-09 07:10:07.492087
$ submit: