Simple Go HTTP client with Black Magic
Simple Go HTTP client with Black Magic
Simple and easy to use, providing rich client-level and request-level settings, all of which are intuitive and chainable methods
Provides powerful and convenient debug utilities, including debug logs, performance traces, and even dump the complete request and response content (See Debugging)
API testing can be done with minimal code, no need to explicitly create any Request or Client, or even to handle errors (See Quick HTTP Test)
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
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 automatic request retry and is fully customizable (See Retry)
You can download and upload files with simple request settings, and even set a callback to show real-time progress (See Download and Upload)
req.Transport is exportable. Compared with http.Transport, it also supports HTTP3, dump content, middleware, etc. It can directly replace the Transport of http.Client in existing projects, and obtain more powerful functions with minimal code change
Support Middleware for Request, Response, Client and Transport (See Request and Response Middleware and Client and Transport Middleware)