{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-09-09T13:48:10Z","object_id":{"id":335,"is_a":["text","documentation","reference","module"],"name":"doc_core","title":"Zotonic Core","uri":"https:\/\/zotonic.com\/id\/335"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"references":{"objects":[{"created":"2020-05-30T05:48:17Z","object_id":{"id":1300,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_print","title":"print","uri":"https:\/\/zotonic.com\/id\/1300"},"seq":1000000},{"created":"2020-05-30T05:48:17Z","object_id":{"id":1461,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_escape","title":"escape","uri":"https:\/\/zotonic.com\/id\/1461"},"seq":1000000},{"created":"2020-05-30T05:48:17Z","object_id":{"id":1942,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_make_list","title":"make_list","uri":"https:\/\/zotonic.com\/id\/1942"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:48:10Z","object_id":{"id":1300,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_print","title":"print","uri":"https:\/\/zotonic.com\/id\/1300"},"seq":1000000},{"created":"2026-09-09T13:48:10Z","object_id":{"id":1461,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_escape","title":"escape","uri":"https:\/\/zotonic.com\/id\/1461"},"seq":1000000},{"created":"2026-09-09T13:48:10Z","object_id":{"id":1942,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_make_list","title":"make_list","uri":"https:\/\/zotonic.com\/id\/1942"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-09-09T13:48:10Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":3},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":4},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2643,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_query","title":"Query","uri":"https:\/\/zotonic.com\/id\/2643"},"seq":5},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2665,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_structured_data","title":"Structured data","uri":"https:\/\/zotonic.com\/id\/2665"},"seq":6},{"created":"2026-09-09T13:48:10Z","object_id":{"id":2676,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_http","title":"HTTP","uri":"https:\/\/zotonic.com\/id\/2676"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2101,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2101"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_req","page_url":{"en":"https:\/\/zotonic.com\/docs\/2101\/req","x-default":"https:\/\/zotonic.com\/docs\/2101\/req"},"preview_url":null,"resource":{"version":4013,"pivot_location_lat":null,"title":"req","is_authoritative":true,"body":"<p>This model gives access to the request variables from within a template.<\/p>\n<p>Sometimes you need direct access to request variables in your template. The m_req model is meant for this. It exposes\nsome values from the Cowmachine request record.<\/p>\n<h2>Fetching a single value<\/h2>\n<p>You can fetch individual values by key, for example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{{ m.req.host|escape }}\n<\/code><\/pre>\n<h2>Viewing all request variables<\/h2>\n<p>Use the <a href=\"\/id\/doc_template_tag_tag_print\" class=\"doc-reference doc-reference-tag\"><code>tag#print<\/code><\/a> tag to get a complete overview of all request variables:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% print m.req|make_list %}\n<\/code><\/pre>\n<p>This will show something like:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">[{method,&lt;&lt;&quot;GET&quot;&gt;&gt;},\n {version,{1,1}},\n {peer,&lt;&lt;&quot;127.0.0.1&quot;&gt;&gt;},\n {is_ssl,false},\n {host,&lt;&lt;&quot;mysite.test&quot;&gt;&gt;},\n {raw_path,&lt;&lt;&quot;\/en\/page\/1234?foo=bar&quot;&gt;&gt;},\n {path,&lt;&lt;&quot;\/en\/page\/1234&quot;&gt;&gt;},\n {qs,[{&lt;&lt;&quot;foo&quot;&gt;&gt;,&lt;&lt;&quot;bar&quot;&gt;&gt;}]},\n {referrer,&lt;&lt;&quot;http:\/\/mysite.test:8000\/&quot;&gt;&gt;},\n {user_agent,&lt;&lt;&quot;Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit\/601.4.4 (KHTML, like Gecko) Version\/9.0.3 Safari\/601.4.4&quot;&gt;&gt;},\n {is_crawler,false},\n {req_id,525158920},\n {headers,[{&lt;&lt;&quot;accept&quot;&gt;&gt;,\n            &lt;&lt;&quot;text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8&quot;&gt;&gt;},\n           {&lt;&lt;&quot;accept-encoding&quot;&gt;&gt;,&lt;&lt;&quot;gzip, deflate&quot;&gt;&gt;},\n           {&lt;&lt;&quot;accept-language&quot;&gt;&gt;,&lt;&lt;&quot;en-us&quot;&gt;&gt;},\n           {&lt;&lt;&quot;cache-control&quot;&gt;&gt;,&lt;&lt;&quot;max-age=0&quot;&gt;&gt;},\n           {&lt;&lt;&quot;connection&quot;&gt;&gt;,&lt;&lt;&quot;keep-alive&quot;&gt;&gt;},\n           {&lt;&lt;&quot;cookie&quot;&gt;&gt;,\n            &quot;z_logon=; z_sid=LopWHBmHXCs94virnboZhBHLKV6m1Cga; z_ua=c%3Ddesktop%26u%3D1%26t%3D1%26w%3D1920%26h%3D1200&quot;},\n           {&lt;&lt;&quot;dnt&quot;&gt;&gt;,&lt;&lt;&quot;1&quot;&gt;&gt;},\n           {&lt;&lt;&quot;host&quot;&gt;&gt;,&lt;&lt;&quot;mysite.test:8000&quot;},\n           {&lt;&lt;&quot;referer&quot;&gt;&gt;,&lt;&lt;&quot;http:\/\/mysite.test:8000\/&quot;&gt;&gt;},\n           {&lt;&lt;&quot;user-agent&quot;&gt;&gt;,\n            &lt;&lt;&quot;Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit\/601.4.4 (KHTML, like Gecko) Version\/9.0.3 Safari\/601.4.4&quot;&gt;&gt;}]},\n {timezone,&lt;&lt;&quot;UTC&quot;&gt;&gt;},\n {language,en}]\n<\/code><\/pre>\n<p>Please note that all values are raw and not escaped, take care to escape the values before you use them in your\ntemplates, using the <a href=\"\/id\/doc_template_filter_filter_escape\" class=\"doc-reference doc-reference-filter\"><code>filter#escape<\/code><\/a> filter.<\/p>\n<p>The <a href=\"\/id\/doc_template_filter_filter_make_list\" class=\"doc-reference doc-reference-filter\"><code>filter#make_list<\/code><\/a> filter is used to force the evaluation of the model;\notherwise it would just print <code>{m,req,undefined}<\/code>.<\/p>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/+key\/...<\/code><\/td><td>Return request\/context value for key <code>+key<\/code> (must map to an existing atom key); returns <code>unknown_key<\/code> for unknown key names.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/<\/code><\/td><td>Return default request overview list from <code>values\/1<\/code> (<code>method<\/code>, <code>version<\/code>, <code>peer<\/code>, <code>is_ssl<\/code>, <code>host<\/code>, <code>port<\/code>, <code>raw_path<\/code>, <code>path<\/code>, <code>qs<\/code>, <code>referrer<\/code>, <code>user_agent<\/code>, <code>is_crawler<\/code>, <code>headers<\/code>, <code>timezone<\/code>, <code>language<\/code>). No further lookups.<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>\n<h2>Known Keys<\/h2>\n<p>The following keys are recognized by <code>m.req.+key<\/code>:<\/p>\n<table class=\"table\"><thead><tr><th>Key<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>method<\/code><\/td><td>HTTP method as binary, for example <code>&lt;&lt;&quot;GET&quot;&gt;&gt;<\/code>.<\/td><\/tr><tr><td><code>version<\/code><\/td><td>HTTP protocol version tuple, for example <code>{1,1}<\/code>.<\/td><\/tr><tr><td><code>peer<\/code><\/td><td>Remote client IP as binary text.<\/td><\/tr><tr><td><code>peer_ip<\/code><\/td><td>Remote client IP as tuple form.<\/td><\/tr><tr><td><code>is_ssl<\/code><\/td><td>Whether request is HTTPS (<code>true<\/code>\/<code>false<\/code>).<\/td><\/tr><tr><td><code>scheme<\/code><\/td><td>Request scheme (<code>&lt;&lt;&quot;http&quot;&gt;&gt;<\/code> \/ <code>&lt;&lt;&quot;https&quot;&gt;&gt;<\/code>).<\/td><\/tr><tr><td><code>host<\/code><\/td><td>Request host header (without path).<\/td><\/tr><tr><td><code>port<\/code><\/td><td>Effective request port (proxy-aware; site config port when not proxied).<\/td><\/tr><tr><td><code>raw_path<\/code><\/td><td>Raw request path including query string.<\/td><\/tr><tr><td><code>path<\/code><\/td><td>Request path without query string.<\/td><\/tr><tr><td><code>qs<\/code><\/td><td>Parsed query arguments list.<\/td><\/tr><tr><td><code>headers<\/code><\/td><td>All request headers as <code>{Name, Value}<\/code> pairs.<\/td><\/tr><tr><td><code>referer<\/code><\/td><td><code>Referer<\/code> request header value.<\/td><\/tr><tr><td><code>referrer<\/code><\/td><td>Alias of <code>referer<\/code>.<\/td><\/tr><tr><td><code>user_agent<\/code><\/td><td>User-Agent header value (truncated to max 500 chars).<\/td><\/tr><tr><td><code>is_crawler<\/code><\/td><td>Whether User-Agent is detected as crawler.<\/td><\/tr><tr><td><code>site<\/code><\/td><td>Current Zotonic site name.<\/td><\/tr><tr><td><code>timezone<\/code><\/td><td>Current request\/context timezone.<\/td><\/tr><tr><td><code>language<\/code><\/td><td>Current request\/context language.<\/td><\/tr><tr><td><code>is_http_request<\/code><\/td><td>Context flag indicating HTTP request processing context.<\/td><\/tr><tr><td><code>session_id<\/code><\/td><td>Current session id when available, else <code>undefined<\/code>.<\/td><\/tr><tr><td><code>csp_nonce<\/code><\/td><td>CSP nonce for the current response\/context.<\/td><\/tr><\/tbody><\/table>","slug":"req","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"2a6dfdebec6884e1225d24b64935119435e3ea7d1e54410b53beac6b87ed4d43","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_core\/src\/models\/m_req.erl","publication_start":"2023-06-24T08:18:00Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_core\/src\/models\/m_req.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_req","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:48:00Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_core","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"c19e5c894d3bd01b57581e2af43e176d42c6877a\n","erlang_module":"m_req","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-08T10:41:08Z","title_slug":"req"},"uri":"https:\/\/zotonic.com\/id\/2101","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2101"}},"status":"ok"}