View Single Post
Posts: 284 | Thanked: 661 times | Joined on Aug 2013 @ Finland
#103
is your API key embedded to url? Then you can just do this:

Code:
let url = 'https.//www.example.com?api_key=' + API_key;
the key might need to be converted to string, perhaps. Also need to check what name the API key has, it might not be api_key like in the url.

I would then use fetch api to get the response:

Code:
let response = await fetch(url);
let data = await response.json();

// parse data here
 

The Following 3 Users Say Thank You to Thoke For This Useful Post: