Req is a Go package for HTTP calls with fluent client- and request-level options, debugging aids, retries, uploads, and optional TLS fingerprint impersonation.
Overview
Req is a Go HTTP client library built around chainable methods at client and request scope. You import the package, create a client for production traffic, or use global helpers for quick tests. Documentation on the project site covers tutorials, examples, and API details.
It supports HTTP/1.1, HTTP/2, and HTTP/3, with automatic version selection or forced protocol choice. Debug utilities include logs, performance traces, and full request or response dumps. Bodies can marshal and unmarshal based on Content-Type, with automatic UTF-8 decoding when possible.
Authentication helpers cover basic, bearer token, and digest auth. Customizable retry logic, file download and upload with progress callbacks, and middleware hooks for requests, responses, clients, and transports extend behavior. The exportable Transport can replace http.Client transport in existing code to add HTTP/3 and dumping with small changes.
HTTP fingerprint impersonation is advertised for sites that block typical crawler fingerprints. The library targets recent Go releases as stated in its compatibility matrix.
Key features
- Chainable client and request API
- HTTP/1.1, HTTP/2, and HTTP/3
- Debug logs and request dumps
- Automatic retry configuration
- Basic, bearer, and digest auth
- Download and upload with progress
- Request and transport middleware
- HTTP fingerprint impersonation support
Use cases
- Go services calling REST APIs
- Scripted API testing in Go
- Building SDKs around HTTP backends
- Scraping sites with fingerprint controls