agiletortoise/drafts-script-reference

Is the HTTP.request() method a async function?

daibor opened this issue · 1 comments

Hi, I run the HTTP.request() method successfully, but the response.success always return 0.I think this method should return a Promise or receive a callback function to get the response.

All Drafts library functions are synchronous. This is intentional because actions are not ongoing processes. They have a determinate execution path. It is possible to use async constructs, but the Script action steps must be marked for aync support and the burden is on the script writer to let Drafts know when the script is complete. See Script object docs.