Last active
June 4, 2018 09:29
-
-
Save TheIncredibleHarsh/7dfc0aab9f57110563939b4fd20c73ed to your computer and use it in GitHub Desktop.
sample code
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
return fetch('https://newsapi.org/v2/top-headlines?country=jp&apiKey=145cae52067945059c40a596650cb455') | |
.then((response) => response.json()) | |
.then((responseJson) => { | |
this.setState({ | |
isLoading: false, | |
dataSource: responseJson.articles, | |
}, function(){ | |
}); | |
}) | |
.catch((error) =>{ | |
console.error(error); | |
}); | |
https://newsapi.org/v2/top-headlines?country=us&apiKey=145cae52067945059c40a596650cb455 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment