You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -27,6 +28,8 @@ An easy-to-use HTTP request tool for Golang.
27
28
- Serialize request body automatically.
28
29
- Response body deserialization wrapper.
29
30
- Decode the compressed response body automatically.
31
+
- Chaining API.
32
+
- Request and Response interceptors.
30
33
31
34
## Installation
32
35
@@ -104,6 +107,18 @@ You can also set `Timeout` to `request.RequestTimeoutNone` to disable the timeou
104
107
105
108
> The timeout will be disabled if you set `Context` in the request config, you need to handle it manually.
106
109
110
+
### Chaining API
111
+
112
+
You can also make a request by chaining API:
113
+
114
+
```go
115
+
resp, err:= request.Req("http://example.com").
116
+
POST().
117
+
SetBody(map[string]any{ "title": "Apple" }).
118
+
SetTimeout(3000).
119
+
Do()
120
+
```
121
+
107
122
### Response body handling
108
123
109
124
We provided `ToObject` and `ToString` methods to handle response body. For example, the `ToString` method will read all data in the response body, and return it that represented in a string value.
0 commit comments