How should express write a request in promise?

  HTTP.call("GET","http://10.1.62.120:8000/data/projects/0017/experiments",{
                            auth: "admin:admin"
                        }, (error, result) =>{});
                        

this is the current way of writing, how should I modify it?

Jan.08,2022

new Promise(function(resolve, reject) {
  HTTP.call('GET','http://10.1.62.120:8000/data/projects/0017/experiments',{
                            auth: "admin:admin"
                        }, (error, result) =>{
                            if (error) {
                                reject(error);
                            } else {
                                resolve(result);
                            }
                        });
});
Menu