Kong / unirest-nodejs

Unirest in Node.js: Simplified, lightweight HTTP client library.
http://unirest.io/nodejs
MIT License
949 stars 167 forks source link

Unirest is running asynchronously #139

Open grizzlyfute opened 3 years ago

grizzlyfute commented 3 years ago

Hello,

I have noticed that unirest 0.6.0 is running asynchronously. The code reproducing is

unirest
  .post ("http://localhost/serverurl")
  .headers ({ 'Content-Type': 'application/x-www-form-urlencoded;' })
  .end ((x) => console.log("OK " + JSON.stringify(x)));
console.log("End");

The excepted output is

OK { json data }
End

But got

End 
OK { json data }

Thanks.