nl_tokens: Represents an incoming client request . @class Request @constructor @param { Object } props @param { String } props . url Request URL @param { String } props . method Request method ( GET POST ... ) @param { Object } props . headers Request headers @param { Buffer } props . upgrade Whether or not the request is an upgrade request @param { Buffer } props . rawBody Request body if any Request URL path including GET parameters ( eg . / foo / bar / qux / articles?order = date ) .
pl_tokens: function Request ( props ) { // From the constructor parameter this . url = props . url ; this . method = ( props . method || 'GET' ) . toUpperCase ( ) ; this . headers = extendObject ( { } , props . headers || { } ) ; this . upgrade = props . upgrade || false ; this . rawBody = props . rawBody || new Buffer ( "" ) ; this . body = bufferParser . parse ( this . rawBody , this . <mask> ) ; // Calculated this . queryParams = url . parse ( this . url , true ) . query ; Object . defineProperty ( this , "getParams" , { get : function ( ) { deprecationWarning ( "'getParams' is deprecated, use 'queryParams' instead" ) ; return this . queryParams ; } } ) ; Object . defineProperty ( this , "bodyParams" , { get : function ( ) { deprecationWarning ( "'bodyParams' is deprecated, use 'body' instead" ) ; try { return qs . parse ( this . rawBody . toString ( ) ) ; } catch ( e ) { // Ignore, we don't care if the body could not be parsed return null ; } } } ) ; if ( this . url === undefined ) { throw new InvalidRoboHydraRequestException ( 'url' , this . url ) ; } }