This commit is contained in:
2023-02-20 20:25:38 +01:00
parent bed65c76cb
commit 3024c907eb
3 changed files with 170 additions and 125 deletions

View File

@@ -48,6 +48,10 @@ func Runclient(cfg *cfg.Config, args []string) error {
postfiles[filepath.Base(file)] = file
}
// FIXME: doesn't set name=upload[]
// see https://github.com/go-resty/resty/issues/617
// however, this works:
// curl -X POST localhost:8080/api/putfile -F "upload[]=@xxx" -F "upload[]=@yyy" -H "Content-Type: multipart/form-data"
resp, err := client.R().
SetFiles(postfiles).
SetFormData(map[string]string{"expire": "1d"}).