Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- responseJSON.articles.forEach(article => {
- const url = `https://wt.kpi.fei.tuke.sk/api/article/${article.id}`;
- fetch(url)
- .then(response =>{
- if(response.ok){
- return response.json();
- }else{
- return Promise.reject(
- new Error(`Server answered with ${response.status}: ${response.statusText}.`));
- }
- })
- .then(responseJSON => {
- console.log(responseJSON);
- console.log(`article_content : ${responseJSON.content}`);
- })
- .catch (error => {
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement