partial.js logo
Latest version
v1.3.1 (RC2)


Request prototype is available in each node.js / partial.js script. This prototype is defined in Framework (index.js).

Properties {Object}request.flags {String Array} {String}request.ip {String}request.isAuthorized {Boolean}request.isProxy {Boolean}request.isSecure {Boolean}request.path {String Array}request.prefix {String}request.session {Object}request.subdomain {String Array}request.uri {URI}request.user {Object}request.xhr {Boolean};
return Object;

Current request data ( = {}, = {}, = [])

request.flags;Default: []
return String Array;

Current request flags.;
return String;

Current request host.

return String;

Current request IP.

request.isAuthorized;Default: false
return Boolean;

Is authorized? (framework.onAuthorization)

request.isProxy;Default: false
return Boolean;

Is proxy request?

request.isSecure;Default: false
return Boolean;

Is secured request?

return String Array;

Current relative URL path.

request.prefix;Default: ''
return String;

Current prefix.

request.session;Default: null
return Object;

Session object.

request.subdomain;Default: []
return String Array;

Current request subdomain.

return URI;

Current URI object.

request.user;Default: null
return Object;

User object.

request.xhr;Default: false
return Boolean;

Is XHR request?


Request.prototype.authorization();Default: { user: '', password: '' }
return Object;

Read authorization data from the request. Method return { name: 'username', password: 'password' } - if it contains the request.

return Request;

Clear uploaded files. This function is executed automatically.

Request.prototype.cookie(name);Default: ''
return String;

Read value from cookie. For write cookies read Response.prototype.

return String;

Get hostname from URL address.