request / request-promise-native

The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.
ISC License
1.1k stars 63 forks source link

Request acts like Promise but not returning an actual Promise #42

Closed tiger31 closed 5 years ago

tiger31 commented 5 years ago

request(/*url*/) Has then and catch blocks but it's not an actual Promise instance. It returns Request.

Node.js log:

> const rq = require("request-promise-native")
undefined
> const axios = require('axios')
undefined
> (rq("https://google.com") instanceof Promise)
false
> (rq("https://google.com").then() instanceof Promise)
true
> (axios("https://google.com") instanceof Promise)
true
analog-nico commented 5 years ago

Please use rq(...).promise() to get the actual Promise.

tiger31 commented 5 years ago

Thanks, didn't find this one in docs