samples/Orders/orders-script/content.js
function fetchOrders() {
    return new Promise((resolve, reject) => {
        https.get('https://services.odata.org/V4/Northwind/Northwind.svc/Orders',
        (result) => {
            var str = '';
            result.on('data', (b) => str += b);
            result.on('error', reject);
            result.on('end', () => resolve(JSON.parse(str).value));
        });
    })
}
function fetchOrders() {
    return new Promise((resolve, reject) => {
        https.get('https://services.odata.org/V4/Northwind/Northwind.svc/Orders',
        (result) => {
            var str = '';
            result.on('data', (b) => str += b);
            result.on('error', reject);
            result.on('end', () => resolve(JSON.parse(str).value));
        });
    })
}
function fetchOrders ( ) { return new Promise ( ( resolve , reject ) => { https . get ( 'https://services.odata.org/V4/Northwind/Northwind.svc/Orders' , ( result ) => { var str = '' ; result . on ( 'data' , ( b ) => str += b ) ; result . on ( 'error' , reject ) ; result . on ( 'end' , ( ) => resolve ( JSON . parse ( str ) . value ) ) ; } ) ; } ) }
call remote http rest api
call remote http rest api