Tuesday, September 27, 2022

Fetching data from API

https://javascript.info/json

https://learn.javascript.ru/fetch

https://blog.logrocket.com/modern-api-data-fetching-methods-react/

https://stackoverflow.com/questions/39019094/reactjs-get-json-object-data-from-an-url

const fetchData = fetch('api/v1/cards', {
method: 'GET',
dataType: 'json',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
},
})
.then((res) => res.json())
.then((obj) => {
// console.log(obj.data.cards);
// console.log(obj);
return Promise.resolve(obj.data.cards);
})
.catch((err) => {
console.log('Error getting data', err);
throw err;
});

console.log(fetchData);

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve

https://stackoverflow.com/questions/33237200/fetch-response-json-gives-responsedata-undefined

https://stackoverflow.com/questions/51619534/fetch-data-from-mongoose-and-put-into-an-array

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all

https://stackoverflow.com/questions/64611880/how-to-fetch-an-array-object-from-api-json-file

https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call

https://stackoverflow.com/questions/37533929/how-to-return-data-from-promise

https://www.digitalocean.com/community/tutorials/how-to-use-the-javascript-fetch-api-to-get-data

https://stackoverflow.com/questions/60791658/value-undefined-returned-from-fetch-promise

https://stackoverflow.com/questions/12460378/how-to-get-json-from-url-in-javascript

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

https://stackoverflow.com/questions/66655216/why-is-my-response-data-undefined-when-sending-a-fetch

https://stackoverflow.com/questions/72217657/fetch-json-data-from-url-and-write-in-a-file

https://www.freecodecamp.org/news/json-stringify-example-how-to-parse-a-json-object-with-javascript/

https://stackoverflow.com/questions/43871637/no-access-control-allow-origin-header-is-present-on-the-requested-resource-whe

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Fetching_data

No comments:

Post a Comment