mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-23 00:13:24 +01:00
49 lines
509 B
Plaintext
49 lines
509 B
Plaintext
|
meta {
|
||
|
name: echo json
|
||
|
type: http
|
||
|
seq: 1
|
||
|
}
|
||
|
|
||
|
post {
|
||
|
url: {{host}}/api/echo/json
|
||
|
body: json
|
||
|
auth: none
|
||
|
}
|
||
|
|
||
|
headers {
|
||
|
foo: bar
|
||
|
}
|
||
|
|
||
|
auth:basic {
|
||
|
username: asd
|
||
|
password: j
|
||
|
}
|
||
|
|
||
|
auth:bearer {
|
||
|
token:
|
||
|
}
|
||
|
|
||
|
body:json {
|
||
|
{
|
||
|
"hello": "bruno"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
assert {
|
||
|
res.status: eq 200
|
||
|
}
|
||
|
|
||
|
script:pre-request {
|
||
|
bru.setVar("foo", "foo-world-2");
|
||
|
}
|
||
|
|
||
|
tests {
|
||
|
test("should return json", function() {
|
||
|
const data = res.getBody();
|
||
|
expect(res.getBody()).to.eql({
|
||
|
"hello": "bruno"
|
||
|
});
|
||
|
});
|
||
|
|
||
|
}
|