Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
feat: Add support for file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
syakir-alphaus committed Feb 3, 2021
1 parent d660414 commit 7d1ee4b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ func doScenario(in *doScenarioInput) error {
req = req.WithQuery(k, nv)
}

if len(run.HTTP.Files) > 0 {
req = req.WithMultipart()
}
for k, v := range run.HTTP.Files {
fn := fmt.Sprintf("%v_files.%v", prefix, k)
nv, _ := s.ParseValue(v, fn)
req = req.WithFile(k, nv)
}

for k, v := range run.HTTP.Forms {
fn := fmt.Sprintf("%v_forms.%v", prefix, k)
nv, _ := s.ParseValue(v, fn)
Expand Down

0 comments on commit 7d1ee4b

Please # to comment.