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 User Location object that contains properties specifying the geographic location.

device returns the Device that specifies client device characteristics.

cacheKey returns the cacheKey that specifies the HTTP response in cache for an HTTP request.