Yes, aftJS supports the omnipresent fetch, which JavaScript programmers love to use to perform HTTP(S) methods (like GET, POST, and so on...).


So, in aftJS you can do something like this:


{
  var x = fetch('https://kb.syncplify.me/').then(function(r) {
    r.text().then(function(d) {
      Log(r.statusText); 
      for (var k in r.headers._headers) {
        Log(k + ':', r.headers.get(k));
      }
      Log('');
      Log(d);
    });
  });
}


Or use it to call some other REST API, like this:


{
 fetch('https://httpbin.org/post', {
  method: 'post',
  headers: {
    'Accept': 'application/json, text/plain, */*',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({a: 7, str: 'Some string: &=&'})
 }).then(res => res.json())
  .then(res => Log(res));
}


Or do pretty much everything you'd do with JavaScript's native fetch function.