This pull request allows using promises in unirest. By default, it also implements async/await.
The idea is that by defining then and returning a promise from it will also enable async/await.
Invoking then returns a proper promise chain with the callback try/catch wrapped so that errors that occur inside the callback can get handled by the catch method of the promise chain.
This pull request allows using promises in unirest. By default, it also implements async/await.
The idea is that by defining
then
and returning a promise from it will also enable async/await.Invoking
then
returns a proper promise chain with the callback try/catch wrapped so that errors that occur inside the callback can get handled by the catch method of the promise chain.