mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-24 21:25:45 +00:00
31 lines
632 B
Plaintext
31 lines
632 B
Plaintext
meta {
|
|
name: echo multipart
|
|
type: http
|
|
seq: 8
|
|
}
|
|
|
|
post {
|
|
url: {{echo-host}}
|
|
body: multipartForm
|
|
auth: none
|
|
}
|
|
|
|
body:multipart-form {
|
|
foo: {"bar":"baz"} @contentType(application/json--test)
|
|
form-data-key: {{form-data-key}}
|
|
form-data-stringified-object: {{form-data-stringified-object}}
|
|
file: @file(bruno.png)
|
|
}
|
|
|
|
assert {
|
|
res.body: contains form-data-value
|
|
res.body: contains {"foo":123}
|
|
res.body: contains Content-Type: application/json--test
|
|
}
|
|
|
|
script:pre-request {
|
|
let obj = JSON.stringify({foo:123});
|
|
bru.setVar('form-data-key', 'form-data-value');
|
|
bru.setVar('form-data-stringified-object', obj);
|
|
}
|