Request Object

The Request Object represents the HTTP request. It contains properties that provide details and context about the request, as well as properties that allow for modifying the request.

method

The HTTP method of the incoming request. This is a read-only string value.

// GET /search?q=something 
request.method 
// => "GET"

scheme

The scheme of the incoming request ("http" or "https"). This is a read-only string value.

// https://www.example.com/search?q=something
request.scheme
// => "https"

host

The host header value of the incoming request. This is a read-only string value.

// Host: www.example.com 
request.host   
// => "www.example.com"

path

The URL path of the incoming request, including the filename and extension, but without any query string. This is a read-only string value.

// https://www.example.com/search?q=something
request.path 
// => "/search"

query

The query string of the incoming request. This is a read-only string value.

// GET /search?q=something
request.query
// => "q=something"

url

The relative path and query string of the incoming request. This is a read-only string value.

// https://www.example.com/search?q=something
request.url  
// => "/search?q=something"

cpCode

A unique identifier in the form of an unsigned integer that is used for reporting site traffic usage data. This is a read-only value.

// Request cpCode 12345
 request.cpCode 
// => 12345

userlocation

Returns the object that contains properties specifying the geographic location.

For more information see the User Location Object .

device

Returns information that specifies client device characteristics.

For more information see the Device Object.

cacheKey

Returns the methods that specify the HTTP response in cache for an HTTP request.

For more information see the cacheKey Object.