Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- const response = await fetch(url, {
- method: 'GET',
- headers: {
- 'Content-Type': "application/json",
- 'Accept': 'application/json'
- }
- });
- } catch (err) {
- console.log(err)
- }
- you need to modify like below
- fetch(url)
- .then((resp) => resp.json()) // Transform the data into json
- .then(function(data) {
- // your code logic with the response
- })
- })
Add Comment
Please, Sign In to add comment