2024-09-23 12:24:54 +02:00
|
|
|
meta {
|
|
|
|
name: echo multipart
|
|
|
|
type: http
|
|
|
|
seq: 8
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
url: {{echo-host}}
|
|
|
|
body: multipartForm
|
|
|
|
auth: none
|
|
|
|
}
|
|
|
|
|
|
|
|
body:multipart-form {
|
2024-10-01 14:54:03 +02:00
|
|
|
form-data-key: {{form-data-key}}
|
|
|
|
form-data-stringified-object: {{form-data-stringified-object}}
|
2024-09-23 12:24:54 +02:00
|
|
|
file: @file(bruno.png)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert {
|
|
|
|
res.body: contains form-data-value
|
2024-10-01 14:54:03 +02:00
|
|
|
res.body: contains {"foo":123}
|
2024-09-23 12:24:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
script:pre-request {
|
2024-10-01 14:54:03 +02:00
|
|
|
let obj = JSON.stringify({foo:123});
|
2024-09-23 12:24:54 +02:00
|
|
|
bru.setVar('form-data-key', 'form-data-value');
|
2024-10-01 14:54:03 +02:00
|
|
|
bru.setVar('form-data-stringified-object', obj);
|
2024-09-23 12:24:54 +02:00
|
|
|
}
|