Simple Go HTTP client with Black Magic

GitHub Repo stars GitHub Releases Mentioned in Awesome Go

Simple and Powerful

Simple and easy to use, providing rich client-level and request-level settings, all of which are intuitive and chainable methods

Easy Debugging

Provides powerful and convenient debug utilities, including debug logs, performance traces, and even dump the complete request and response content (See Debugging)

Easy API Testing

API testing can be done with minimal code, no need to explicitly create any Requests and Clients, or even to handle errors (See Quick HTTP Test)

Smart by Default

Detect and decode to utf-8 automatically if possible to avoid garbled characters (See Auto Decode), marshal request body and unmarshal response body automatically according to the Content-Type

Support Multiple HTTP Versions

Req support HTTP/1.1, HTTP/2, and HTTP/3, and can automatically detect the server side and select the optimal HTTP version for requests, you can also force the protocol if you want (See Force HTTP version)

Support Retry

Support automatic request retry and is fully customizable (See Retry)

Easy Download and Upload

You can download and upload files with simple request settings, and even set a callback to show real-time progress (See Download and Upload)

Exportable

Transport is exportable, which support dump requests, it's easy to integrate with existing http.Client, so you can debug APIs with minimal code change

Extensible

Support Middleware for Request and Response (See Request and Response Middleware)