File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,30 @@ Content-Disposition: form-data; name="parameterName"
191
191
ParameterValue
192
192
```
193
193
194
+ #### AddObject
195
+
196
+ You can avoid calling ` AddParameter ` multiple times if you collect all the parameters in an object, and then use ` AddObject ` .
197
+ For example, this code:
198
+
199
+ ``` csharp
200
+ var params = new {
201
+ status = 1 ,
202
+ priority = " high" ,
203
+ ids = new [] { " 123" , " 456" }
204
+ };
205
+ request .AddObject (params );
206
+ ```
207
+
208
+ is equivalent to:
209
+
210
+ ``` csharp
211
+ request .AddParameter (" status" , 1 );
212
+ request .AddParameter (" priority" , " high" );
213
+ request .AddParameter (" ids" , " 123,456" );
214
+ ```
215
+
216
+ Remember that ` AddObject ` only works if your properties have primitive types. It also works with collections of primitive types as shown above.
217
+
194
218
### Url Segment
195
219
196
220
Unlike ` GetOrPost ` , this ` ParameterType ` replaces placeholder values in the ` RequestUrl ` :
You can’t perform that action at this time.
0 commit comments