MCPcopy Create free account
hub / github.com/imroc/req / SetFiles

Method SetFiles

request.go:292–297  ·  view source on GitHub ↗

SetFiles set up a multipart form from a map to upload, which key is the parameter name, and value is the file path.

(files map[string]string)

Source from the content-addressed store, hash-verified

290// SetFiles set up a multipart form from a map to upload, which
291// key is the parameter name, and value is the file path.
292func (r *Request) SetFiles(files map[string]string) *Request {
293 for k, v := range files {
294 r.SetFile(k, v)
295 }
296 return r
297}
298
299// SetFile set up a multipart form from file path to upload,
300// which read file from filePath automatically to upload.

Callers 3

SetFilesFunction · 0.80
TestUploadMultipartFunction · 0.80
TestSetFilesFunction · 0.80

Calls 1

SetFileMethod · 0.95

Tested by 2

TestUploadMultipartFunction · 0.64
TestSetFilesFunction · 0.64