Code:
fetch(`https://api.flickr.com/services/rest/?&method=flickr.photos.search&api_key=++++++++++&tags=obama&format=json&extras=url_m&nojsoncallback=true`, {
method: "GET",
headers : {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}).then(response => {
console.log(response.json())
})
Output:
Promise {_40: 0, _65: 0, _55: null, _72: null}
You could await the response:
fetch(url, options).then(async (response) => {
const data = await response.json();
console.log(data)
})
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments