Created
August 2, 2017 07:23
-
-
Save jvadillo/ba86b8180f959329cfbe0885f261a901 to your computer and use it in GitHub Desktop.
How to use fetch-jsonp library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetchJsonp from 'fetch-jsonp'; | |
function handleSearch(user){ | |
//let url = 'https://api.github.com/users/'+user+'/repos'; | |
const token = '304163526.e0b4176.e924858e024645989aae580c6523aee0'; | |
let url = 'https://api.instagram.com/v1/tags/akebaso/media/recent?access_token=304163526.e0b4176.e924858e024645989aae580c6523aee0'; | |
fetchJsonp(url, { | |
method: 'GET', | |
mode: 'no-cors', | |
credentials: 'include', | |
}) | |
.then(response => response.json()) | |
.then(response => {}); | |
/*fetch(url,{'mode': 'no-cors'}). | |
then(response => response.json()).then((repos) => { | |
console.log(repos); | |
console.log(repos.length); | |
});*/ | |
} | |
handleSearch("jvadillo"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment