File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ type graphResponse struct {
266266type Request struct {
267267 q string
268268 vars map [string ]interface {}
269- files []file
269+ files []File
270270
271271 // Header represent any request headers that will be set
272272 // when the request is made.
@@ -294,26 +294,32 @@ func (req *Request) Var(key string, value interface{}) {
294294// Files are only supported with a Client that was created with
295295// the UseMultipartForm option.
296296func (req * Request ) File (fieldname , filename string , r io.Reader ) {
297- req .files = append (req .files , file {
297+ req .files = append (req .files , File {
298298 Field : fieldname ,
299299 Name : filename ,
300300 R : r ,
301301 })
302302}
303303
304- // file represents a file to upload.
305- type file struct {
304+ // File represents a file to upload.
305+ type File struct {
306306 Field string
307307 Name string
308308 R io.Reader
309309}
310310
311- // RequestVars gets the variables from a request .
311+ // RequestVars gets the variables from a Request .
312312func RequestVars (req * Request ) map [string ]interface {} {
313313 return req .vars
314314}
315315
316- // RequestQuery gets the query from the request .
316+ // RequestQuery gets the query from the Request .
317317func RequestQuery (req * Request ) string {
318318 return req .q
319319}
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