Request Document
The request document is a transient HTML document that represents the current HTTP request. It exists only for the duration of request processing and is addressable via resource bindings and includes during page composition.
Caching. Because the request document carries per-request identity (the
authscope), any page that includes or binds a fragment of it is servedCache-Control: privateand is excluded from the shared cache. The request document is internal: it is not itself addressable over HTTP.Reading a field directly. If you only need a request field (not a selector-addressable fragment), the same data is available as the
requestcontext variable —request.auth.claims.email,request.path,request.method,request.query.*— inside expression bindings and Liquid templates, without a selector.
When to reach for it
Use the request document to access request metadata — path, method, query parameters, headers, and authentication claims — inside templates and bindings. The document does not persist after the request completes.
Shape
The request document uses the https://pagelove.org/Request itemtype. It contains nested scopes for query parameters, headers, and authorization claims.
<!doctype html>
<html lang="en">
<head></head>
<body itemscope itemtype="https://pagelove.org/Request">
<meta itemprop="path" content="/index.html">
<meta itemprop="method" content="GET">
<meta itemprop="query" content="foo=bar">
<meta itemprop="body" content="">
<section itemprop="query" itemscope itemtype="https://pagelove.org/Request/HTTP/Query">
<meta itemprop="foo" content="bar">
</section>
<section itemprop="headers" itemscope itemtype="https://pagelove.org/Request/HTTP/Headers">
<meta itemprop="accept" content="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=8">
<meta itemprop="host" content="docs.pagelove.org">
<meta itemprop="accept-language" content="en-GB,en;q=0.9">
</section>
<section itemprop="auth" itemscope itemtype="https://pagelove.org/Authorization">
<section itemprop="claims" itemscope itemtype="https://pagelove.org/Claims">
<meta itemprop="email" content="james@pagelove.team">
<meta itemprop="name" content="James A. Duncan">
<meta itemprop="sub" content="sub_X3jXrDQvxAJl4s7Y6BVZ6JvE_ipt">
<meta itemprop="picture" content="https://pictures.hello.coop/r/cf47a516-b15b-42c5-bea5-d2694a00be78.jpeg">
</section>
<meta itemprop="username" content="sub_X3jXrDQvxAJl4s7Y6BVZ6JvE_ipt">
<meta itemprop="role" content="james@pagelove.team">
<meta itemprop="role" content="admins">
<meta itemprop="role" content="staff">
<meta itemprop="role" content="users">
</section>
</body>
</html>
Fields
| Field | Itemtype | Description |
|---|---|---|
path |
— | The request path |
method |
— | The HTTP method |
query |
https://pagelove.org/Request/HTTP/Query |
Parsed query parameters as individual properties |
body |
— | The raw request body |
headers |
https://pagelove.org/Request/HTTP/Headers |
Request headers as individual properties |
auth |
https://pagelove.org/Authorization |
Authentication and authorization data, including OIDC claims and roles |
Examples
Request object in a Liquid template
Store a page that renders request properties using p:template:
{% example "setup-reqobj-page", "body" %}
When the page is requested, the template evaluates with the live request data:
GET /sspi-reqobj-page.html
HTTP/1.1 200
<!DOCTYPE html>
<html>
<body>
<section>
<p>Method: GET</p>
<p>Path: /sspi-reqobj-page.html</p>
</section>
</body>
</html>
See also
- Resource Binding — bind CSS selector queries to template variables
- Templating — render request data in Liquid templates