meta { name: node-fetch-pre-req-script type: http seq: 1 } get { url: {{host}}/ping body: none auth: none } script:pre-request { const fetch = require("node-fetch"); const url = "https://testbench-sanity.usebruno.com/api/echo/json"; const response = await fetch(url, { method: 'post', body: JSON.stringify({hello:'bruno'}), headers: {'Content-Type': 'application/json'} }); 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" }); }); }