File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ type graphResponse struct {
266
266
type Request struct {
267
267
q string
268
268
vars map [string ]interface {}
269
- files []file
269
+ files []File
270
270
271
271
// Header represent any request headers that will be set
272
272
// when the request is made.
@@ -294,26 +294,32 @@ func (req *Request) Var(key string, value interface{}) {
294
294
// Files are only supported with a Client that was created with
295
295
// the UseMultipartForm option.
296
296
func (req * Request ) File (fieldname , filename string , r io.Reader ) {
297
- req .files = append (req .files , file {
297
+ req .files = append (req .files , File {
298
298
Field : fieldname ,
299
299
Name : filename ,
300
300
R : r ,
301
301
})
302
302
}
303
303
304
- // file represents a file to upload.
305
- type file struct {
304
+ // File represents a file to upload.
305
+ type File struct {
306
306
Field string
307
307
Name string
308
308
R io.Reader
309
309
}
310
310
311
- // RequestVars gets the variables from a request .
311
+ // RequestVars gets the variables from a Request .
312
312
func RequestVars (req * Request ) map [string ]interface {} {
313
313
return req .vars
314
314
}
315
315
316
- // RequestQuery gets the query from the request .
316
+ // RequestQuery gets the query from the Request .
317
317
func RequestQuery (req * Request ) string {
318
318
return req .q
319
319
}
320
+
321
+ // RequestFiles gets the files that have been set in a
322
+ // Request.
323
+ func RequestFiles (req * Request ) []File {
324
+ return req .files
325
+ }
You can’t perform that action at this time.
0 commit comments