Closed d4nm0 closed 1 year ago
Hi,
So first: i don‘t know much about HOOBS so i probably can‘t help you there.
second: did you want to console log the result? Because you logged the „req“ variable and not the „result“ variable. Maybe it actually works :D?
I thought why not create a widget like this for hoobs. Problem the api request returns me a null in data. I don't understand can you enlighten me?
async function fetchData() { let req = new Request('http://hoobs.local/api/system/cpu'); let headers = { 'accept': '\/', 'Content-Type': 'application/json', 'Authorization': token }; req.headers = headers; let result; try { result = req.loadJSON(); console.log(req) } catch (e) { return undefined; } return result; }
reponse :
,"timeoutInterval":60,"response":null,"allowInsecureRequest":false}