2024-09-23 12:24:54 +02:00
|
|
|
meta {
|
|
|
|
name: echo form-url-encoded
|
|
|
|
type: http
|
|
|
|
seq: 9
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
url: {{echo-host}}
|
|
|
|
body: formUrlEncoded
|
|
|
|
auth: none
|
|
|
|
}
|
|
|
|
|
|
|
|
body:form-urlencoded {
|
|
|
|
form-data-key: {{form-data-key}}
|
2024-10-01 14:54:03 +02:00
|
|
|
form-data-stringified-object: {{form-data-stringified-object}}
|
2024-09-23 12:24:54 +02:00
|
|
|
}
|
|
|
|
|
2024-10-01 14:54:03 +02:00
|
|
|
assert {
|
|
|
|
res.body: eq form-data-key=form-data-value&form-data-stringified-object=%7B%22foo%22%3A123%7D
|
2024-09-23 12:24:54 +02:00
|
|
|
}
|
|
|
|
|
2024-10-01 14:54:03 +02:00
|
|
|
script:pre-request {
|
|
|
|
let obj = JSON.stringify({foo:123});
|
|
|
|
bru.setVar('form-data-key', 'form-data-value');
|
|
|
|
bru.setVar('form-data-stringified-object', obj);
|
2024-09-23 12:24:54 +02:00
|
|
|
}
|