artilleryio / artillery-core

artillery-core - deprecated
Mozilla Public License 2.0
29 stars 104 forks source link

supporting multipart form data #219

Open cskru opened 6 years ago

cskru commented 6 years ago

Aren't you passing formData with read stream? Like this:

           formData: {
                foo: {
                    value: fs.createReadStream(filePath),
                    options: {
                        filename: fileName,
                        contentType: 'application/octet-stream'
                    }
                }
            }

This is how formData works.. I tried this:

config:
  target: 'http://localhost:8000'
  files:
    - "@../file.json"
  phases:
    - duration: 10
      arrivalRate: 1
scenarios:
  - flow:
    - post:
        url: "/bla"
        formData:
          foo:  "@../file.json"

Is my spec right? Do I need to add something to it? My server gives 400 bad request as it is unable to find foo.

This is a perfectly working api and is tested functionally. There is some issue with the way in which formData is sent via request.

Any help is much appreciated.

hassy commented 6 years ago

File uploads are not implemented yet, the @file syntax does not work.

cskru commented 6 years ago

@hassy , thank you for the response. When can we expect this feature? I feel, this is one of the critical use cases. :-)

hassy commented 6 years ago

Two options here:

  1. Someone submits a PR which makes it work
  2. Your team buys a license for Artillery Pro which supports file uploads (along with lots of other useful features)
cskru commented 6 years ago

Okay! Thank you for the response :-)