async function main() { const url = "https://httpbin.org/get"; console.log("Getting: ", url); const response = await fetch(url); console.log("Response: ", response.status); const body = await response.text(); console.log("Body: ", body); return body; } main() .then(result => scriptOutput = result) .catch(err => scriptOutput = err) .finally(() => process.exit());
Run
Use CORS Proxy
Output: