How to use the postman-request.get function in postman-request

To help you get started, we’ve selected a few postman-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github postmanlabs / newman / lib / util.js View on Github external
fetch: function (location, options, callback) {
        !callback && _.isFunction(options) && (callback = options, options = {});

        return (/^https?:\/\/.*/).test(location) ?
            // Load from URL
            request.get({ url: location }, (err, response, body) => {
                if (err) {
                    return callback(err);
                }

                return callback(null, body);
            }) :
            fs.readFile(location, function (err, value) {
                if (err) {
                    return callback(err);
                }

                return callback(null, value.toString());
            });
    },

postman-request

Simplified HTTP request client.

Apache-2.0
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis