I am trying to fetch data from cross origin and getting the error.
Uncaught Error: Can only be used for notebook server requests
I am newbie and could not find any solution.
Sample code:
const settings = ServerConnection.makeSettings();
//settings.baseUrl = "https://api.ipify.org";
console.log(settings)
// uses default settings
const url = 'https://api.ipify.org?format=json';
const init = {"method":"GET", headers: {"Content-Type": "application/json",mode: "cors"}}
// 'Content-Type': 'application/x-www-form-urlencoded'}; // fetch settings (see fetch API link above)
ServerConnection.makeRequest(url, init, settings).then(response => { console.log('got', response); });