mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-12 17:50:51 +01:00
753a576c3c
Safe Mode Sandbox using QuickJS Co-authored-by: Anoop M D <anoop.md1421@gmail.com> Co-authored-by: lohit <lohit.jiddimani@gmail.com>
35 lines
539 B
Plaintext
35 lines
539 B
Plaintext
meta {
|
|
name: axios-pre-req-script
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
get {
|
|
url: {{host}}/ping
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
script:pre-request {
|
|
const axios = require("axios");
|
|
|
|
const url = "https://testbench-sanity.usebruno.com/api/echo/json";
|
|
const response = await axios.post(url, {
|
|
"hello": "bruno"
|
|
});
|
|
|
|
req.setBody(response.data);
|
|
req.setMethod("POST");
|
|
req.setUrl(url);
|
|
}
|
|
|
|
tests {
|
|
test("req.getBody()", function() {
|
|
const data = res.getBody();
|
|
expect(data).to.eql({
|
|
"hello": "bruno"
|
|
});
|
|
});
|
|
|
|
}
|