HTTP Request from inside WASM using gojax-fetch extension for Goja JavaScript virtual machine

This example uses gojax/fetch library.

See the output in browser developer console.

Actual code:


fetch('https://httpbin.org/anything')
  .then(function(res) {
    return res.text();
  }).then(function(txt) {
    console.log(txt);
    exitloop();
  });

Info