src/index.js
function Request(opts, callback) {
    this.opts = opts;
    this.callback = callback;

    Object.defineProperty(this, 'method', {
        get: function() {
            return opts.method;
        },
    });

    Object.defineProperty(this, 'path', {
        get: function() {
            return opts.uri;
        },
    });

    /**
     * Parse the body of the request as a JSON object and return it.
     */
    Object.defineProperty(this, 'data', {
        get: function() {
            return opts.body ? JSON.parse(opts.body) : opts.body;
        },
    });

    /**
     * Return the raw body passed to request
     */
    Object.defineProperty(this, 'rawData', {
        get: function() {
            return opts.body;
        },
    });

    Object.defineProperty(this, 'queryParams', {
        get: function() {
            return opts.qs;
        },
    });

    Object.defineProperty(this, 'headers', {
        get: function() {
            return opts.headers || {};
        },
    });
}
function Request(opts, callback) {
    this.opts = opts;
    this.callback = callback;

    Object.defineProperty(this, 'method', {
        get: function() {
            return opts.method;
        },
    });

    Object.defineProperty(this, 'path', {
        get: function() {
            return opts.uri;
        },
    });

    /**
     * Parse the body of the request as a JSON object and return it.
     */
    Object.defineProperty(this, 'data', {
        get: function() {
            return opts.body ? JSON.parse(opts.body) : opts.body;
        },
    });

    /**
     * Return the raw body passed to request
     */
    Object.defineProperty(this, 'rawData', {
        get: function() {
            return opts.body;
        },
    });

    Object.defineProperty(this, 'queryParams', {
        get: function() {
            return opts.qs;
        },
    });

    Object.defineProperty(this, 'headers', {
        get: function() {
            return opts.headers || {};
        },
    });
}
function Request ( opts , callback ) { this . opts = opts ; this . callback = callback ; Object . defineProperty ( this , 'method' , { get : function ( ) { return opts . method ; } , } ) ; Object . defineProperty ( this , 'path' , { get : function ( ) { return opts . uri ; } , } ) ; /**
     * Parse the body of the request as a JSON object and return it.
     */ Object . defineProperty ( this , 'data' , { get : function ( ) { return opts . body ? JSON . parse ( opts . body ) : opts . body ; } , } ) ; /**
     * Return the raw body passed to request
     */ Object . defineProperty ( this , 'rawData' , { get : function ( ) { return opts . body ; } , } ) ; Object . defineProperty ( this , 'queryParams' , { get : function ( ) { return opts . qs ; } , } ) ; Object . defineProperty ( this , 'headers' , { get : function ( ) { return opts . headers || { } ; } , } ) ; }
Represents a request made by the app.

@constructor
@param {object} opts opts passed to request()
@param {function} callback
Represents a request made by the app .