'Request/request' was my favorite library all the time when i need to make http request in node, however it's deprecated for some time.
I have tried a lot of alternatives but none of them gives me the similar experience as request
does.
Finally, I decided to make one, that will be my pleasure to have you guy's feedback : )
https://github.com/LawsonCheng/poke
import poke from 'js.poke'
// Using promise
poke('https://httpbin.org/anything')
.promise()
.then(result => {
// response body here
console.log(result.body)
// get result in json format
return result.json()
})
.then(json => {
// here is the json object
console.log('json: ', json)
})
.catch(err => {
console.log('> Error: ', err)
})
Top comments (2)
Looks cool, but how is it different from fetch or axios?
The poke library also support listen to difference events,
and easy access to stream : )
E.g
e.g 2