artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.05k stars 511 forks source link

feat(core): specify a Content-Type for individual values when building a formdata request #3316

Closed RikdeVos closed 3 months ago

RikdeVos commented 3 months ago

Description

Based on this discussion: https://github.com/artilleryio/artillery/discussions/3315

Support contentType when building a request with formData. Example:

- post:
    name: Post activity
    url: /climate
    formData:
      activity: '{{ activity }}'
      type: '{{ type }}'
      photo:
        fromFile: './photo.png'
      climate:
        value: '{"temperature": "{{ climate.temperature }}", "unit": "{{ climate.unit }}"}'
        contentType: application/json
    expect:
      - statusCode: 201

TODO

Pre-merge checklist

This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

hassy commented 3 months ago

thank you @RikdeVos! we'll review shortly

hassy commented 3 months ago

(failing tests are as expected & due to a secret not being passed in to the job because of security settings in GHA)

RikdeVos commented 3 months ago

Thanks for the quick review @hassy ! Much appreciated