Closed LureOfAdventure closed 5 years ago
@MarkedWarrior I think you need to call json()
on the resulting object, because you're getting back an instance from node-fetch. See their docs: https://github.com/bitinn/node-fetch#json
Optionally, we provide a toJson
utility function here https://github.com/unsplash/unsplash-js#tojsonres
Note what happens when you do:
unsplash.users.profile('naoufal')
.then(res => console.log(res));
// => logs an object
unsplash.users.profile('naoufal')
.then(res => res.json())
.then(json => console.log(json));
// => logs the actual JSON
@lukechesser I can't believe that was the issue... thank you so much for your patience with me.
No problem :) It's now documented here so I can point people to it
I'm on v6.0.0 and I'm trying to get random photos. Below is how I instantiate the unsplash object and how I query for random photos.
Every time I make a request I get back {"size":0,"timeout":0}
I appreciate any help since I've been stuck on this for quite some time.