voximplant

How to extract the promise contents in Net.httpRequestAsync?


I am not good at JS, how can I extract the promise contents after executing Net.httpRequestAsync and put it into a variable?

I tried to use await but failed.


Solution

  • async function () { 
      let x = await Net.httpRequestAsync(...) 
      ...
    }