Files
bruno/packages/bruno-tests/collection/echo/echo multipart.bru
Dániel Seres cf969dfcd6 fix: Support @contentType for multiline values (#6217)
* fix: Support @contentType for multiline values

Fixes the issue where the @contentType annotation broke the parsing of multiline values.

* chore: add dotall flag to fileExtractContentType

Not strictly needed since body:file uses single-line values in practice,
but doesn't hurt and matches what multipartExtractContentType does.

---------

Co-authored-by: Márk Dániel Seres <markdaniel.seres@tesco.com>
2025-12-08 18:39:25 +05:30

35 lines
793 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)
multiline: '''
"multiline-test"
''' @contentType(application/json--multiline--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
res.body: contains Content-Type: application/json--multiline--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);
}