Http is not defined error

I am not sure about what I am doing wrong, but I get the error: “http is not defined” in the following HTTP call, any hints will be very appreciated:

function HttpGetVegehubData(params) {
    //https://api.vegecloud.com/out/{{RouteKey}}/{{ReadApiKey}}/?limit=10&order=desc
    
    var VegehubDataResult = http.get("https://api.vegecloud.com/out/" + RouteKey +"/" + ReadApiKey + "/" + params);
    if (!VegehubDataResult.data.error) {
        return VegehubDataResult;
    } else {
        return null;
    }
}]

Sorry, I think I just found out… I need to have it defined:
var http = new HTTPClient();

1 Like