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
The following example shows how to decode a response from a GET request
@@ -112,7 +124,7 @@ type Payload interface {
112
124
}
113
125
```
114
126
115
-
###Request options
127
+
## Request options
116
128
117
129
The signature of the `Do` method is:
118
130
@@ -135,7 +147,7 @@ Various options can be passed to modify each individual request when using the `
135
147
*`OptHeader(key, value string)` appends a custom header to the request
136
148
137
149
138
-
###Authentication
150
+
## Authentication
139
151
140
152
The authentication token can be set as follows:
141
153
@@ -159,3 +171,14 @@ func main() {
159
171
// ...
160
172
}
161
173
```
174
+
175
+
You can also set the token on a per-request basis using the `OptToken` option in call to the `Do` method.
176
+
177
+
## Form submission
178
+
179
+
You can create a payload with form data:
180
+
181
+
*`client.NewFormRequest(payload any, accept string)` returns a new request with a Form data payload which defaults to POST.
182
+
*`client.NewMultipartRequest(payload any, accept string)` returns a new request with a Multipart Form data payload which defaults to POST. This is useful for file uploads.
183
+
184
+
The payload should be a `struct` where the fields are converted to form tuples. File uploads require a field of type `multipart.File`.
0 commit comments