Complete reference for accessing request data in templates
When templates are evaluated, they have access to a data model that represents the incoming HTTP request. This page provides a complete reference of all available request attributes and how to access them in your templates.
The data model supplied to response templates contains a single top-level object called request which represents the incoming HTTP request. All request attributes are accessed as properties of this object.
The values for a specific query parameter.Example:request.query.search returns laptop for ?search=laptop
Referencing a query parameter in this manner will return a list of values, but as a convenience only the first will be printed.
As a general rule if you wish to use the first (or only) value of a query parameter in a further expression rather than printing it,
it is necessary to reference it by index explicitly as shown below e.g. request.query.productId.[0]
nth value of a query parameter (zero-indexed), for parameters with multiple values.Example:request.query.tags.[1] returns electronics for ?tags=new&tags=electronics
First value of a request header. Header names are case-insensitive.Example:request.headers.X-Request-Id or request.headers.Content-Type
Referencing a header in this manner will return a list of values, but as a convenience only the first will be printed.
As a general rule if you wish to use the first (or only) value of a header in a further expression rather than printing it,
it is necessary to reference it by index explicitly as shown below e.g. request.headers.X-Proxied-Via.[0]
First value of a request cookie.Example:request.cookies.JSESSIONID
Referencing a cookie in this manner will return a list of values, but as a convenience only the first will be printed.
As a general rule if you wish to use the first (or only) value of a cookie in a further expression rather than printing it,
it is necessary to reference it by index explicitly as shown below e.g. request.cookies.X-Proxied-Via.[0]
For multipart requests, the individual parts are exposed via the template model. Each part can be referenced by its name and exposes several properties.For a multipart request with a part named text, the following properties are available:
A number of HTTP elements (query parameters, form fields, headers, cookies) can be single or multiple valued. The template request model handles this elegantly with a “list or single” type that:
Returns the first (and often only) value when no index is specified
Supports indexed access for multiple values
Provides convenience accessors like first and last
When using the eq helper with one-or-many values, you must use the indexed form, even if only one value is present.The non-indexed form returns the wrapper type (not a String), which will fail comparisons with String values.Correct:
{{#if (eq request.query.status.0 "active")}} Status is active{{/if}}
Incorrect:
{{#if (eq request.query.status "active")}} This will not work as expected{{/if}}
In webhook templates, the triggering request is available as originalRequest instead of request. This distinguishes it from any request data being constructed for the webhook itself.Example:{{originalRequest.headers.X-Correlation-Id}}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"WireMock Cloud","colors":{"primary":"#234E69","light":"#51AFE9","dark":"#234E69"},"logo":{"light":"https://mintcdn.com/wiremockinc/naAVdBHezo3uA-vt/logo/light.svg?fit=max\u0026auto=format\u0026n=naAVdBHezo3uA-vt\u0026q=85\u0026s=d793ceace787ddb9b53e3a8e828b9635","dark":"https://mintcdn.com/wiremockinc/naAVdBHezo3uA-vt/logo/dark.svg?fit=max\u0026auto=format\u0026n=naAVdBHezo3uA-vt\u0026q=85\u0026s=810f6c4093990be5f0ed074a7b863d80","href":"https://www.wiremock.io"},"favicon":"https://mintcdn.com/wiremockinc/m4BUFp24THf4QtFv/favicon.svg?fit=max\u0026auto=format\u0026n=m4BUFp24THf4QtFv\u0026q=85\u0026s=251fb2a34172427153d66e0068127eb9","api":{"openapi":"api-reference/openapi.yaml"},"navbar":{"links":[{"href":"mailto:support@wiremock.io","label":"Get Support"}],"primary":{"type":"button","label":"Login","href":"https://app.wiremock.cloud"}},"footer":{"socials":{"slack":"https://slack.wiremock.org/","x":"https://x.com/wiremockorg","github":"https://github.com/wiremock","linkedin":"https://www.linkedin.com/company/wiremock"}},"seo":{"organization":{"sameAs":["https://wiremock.org","https://www.wiremock.io","https://slack.wiremock.org/","https://x.com/wiremockorg","https://github.com/wiremock","https://www.linkedin.com/company/wiremock/"]}},"integrations":{"ga4":{"measurementId":"G-QGY5DELWWQ"},"gtm":{"tagId":"GTM-PVHGF5P4"},"intercom":{"appId":"xjme6u4w"}},"contextual":{"options":["download-spec"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Slack community","icon":"slack","href":"https://slack.wiremock.org"},{"anchor":"Blog","icon":"newspaper","href":"https://wiremock.io/blog"},{"anchor":"Install With Cursor","icon":"robot","href":"cursor://anysphere.cursor-deeplink/mcp/install?name=WireMock\u0026config=eyJjb21tYW5kIjoid2lyZW1vY2sgbWNwIn0="},{"anchor":"Self-paced Training","icon":"pen","href":"https://wiremockcloud.learnworlds.com/"},{"anchor":"Change Log","icon":"newspaper","href":"https://changes.wiremock.io/"},{"anchor":"System Status","icon":"bell","href":"https://status.wiremock.io/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"wiremockinc","hasAudioNarration":false,"actualSubdomain":"wiremockinc","customDomains":["docs.wiremock.io"],"gitSource":{"type":"github","owner":"wiremock-inc","repo":"public-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae2eadfd4f3f1a7afdfbb1c","collectionId":"28818abd-3589-4243-9e15-6eea2ca7a1ac","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae2eadfd4f3f1a7afdfbb1c"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae88db40522e59c033ba84e","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"Documentation","count":120},{"language":"default","tag":"API Reference","count":104},{"language":"default","tag":"How-to Guides","count":77},{"language":"default","tag":"Reference","count":26},{"language":"default","tag":"Settings","count":16},{"language":"default","tag":"Templating","count":15},{"language":"default","tag":"Concepts","count":14},{"language":"default","tag":"Stub Mappings","count":11},{"language":"default","tag":"CLI","count":10},{"language":"default","tag":"Requests","count":10}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"code.language-handlebars .block{display:inline-block}"}],"page":{"pagePath":"response-templating/request-model","slug":"/response-templating/request-model","pageMetadata":{"title":"Request Model Reference","description":"Complete reference for accessing request data in templates","sidebarTitle":"Request Model","href":"/response-templating/request-model"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Complete reference for accessing request data in templates\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`When templates are evaluated, they have access to a data model that represents the incoming HTTP request. This page provides a complete reference of all available request attributes and how to access them in your templates.`}),`\n`,_jsx(Heading,{level:`2`,id:`the-request-object`,children:`The Request Object`}),`\n`,_jsxs(_components.p,{children:[`The data model supplied to response templates contains a single top-level object called `,_jsx(_components.code,{children:`request`}),` which represents the incoming HTTP request. All request attributes are accessed as properties of this object.`]}),`\n`,_jsx(Heading,{level:`2`,id:`url-attributes`,children:`URL Attributes`}),`\n`,_jsx(Heading,{level:`3`,id:`request-url`,children:`request.url`}),`\n`,_jsx(_components.p,{children:`The full URL path and query string.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`/products/123?color=red\u0026size=large`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-path`,children:`request.path`}),`\n`,_jsx(_components.p,{children:`The URL path without query parameters.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`/products/123`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-path-n`,children:`request.path.[n]`}),`\n`,_jsx(_components.p,{children:`Individual URL path segments, accessed by zero-based index.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` For path `,_jsx(_components.code,{children:`/api/products/123`}),`, `,_jsx(_components.code,{children:`request.path.[2]`}),` returns `,_jsx(_components.code,{children:`123`})]}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters`,children:`Query Parameters`}),`\n`,_jsx(Heading,{level:`3`,id:`request-query-key`,children:`request.query.key`}),`\n`,_jsx(_components.p,{children:`The values for a specific query parameter.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.query.search`}),` returns `,_jsx(_components.code,{children:`laptop`}),` for `,_jsx(_components.code,{children:`?search=laptop`})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Referencing a query parameter in this manner will return a list of values, but as a convenience only the first will be printed.\nAs a general rule if you wish to use the first (or only) value of a query parameter in a further expression rather than printing it,\nit is necessary to reference it by index explicitly as shown below e.g. `,_jsx(_components.code,{children:`request.query.productId.[0]`})]})}),`\n`,_jsx(Heading,{level:`3`,id:`request-query-key-n`,children:`request.query.key.[n]`}),`\n`,_jsx(_components.p,{children:`nth value of a query parameter (zero-indexed), for parameters with multiple values.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.query.tags.[1]`}),` returns `,_jsx(_components.code,{children:`electronics`}),` for `,_jsx(_components.code,{children:`?tags=new\u0026tags=electronics`})]}),`\n`,_jsx(Heading,{level:`2`,id:`http-method-and-protocol`,children:`HTTP Method and Protocol`}),`\n`,_jsx(Heading,{level:`3`,id:`request-method`,children:`request.method`}),`\n`,_jsx(_components.p,{children:`The HTTP request method.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`POST`}),`, `,_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`PUT`}),`, `,_jsx(_components.code,{children:`DELETE`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-scheme`,children:`request.scheme`}),`\n`,_jsx(_components.p,{children:`The protocol part of the URL.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`https`}),`, `,_jsx(_components.code,{children:`http`})]}),`\n`,_jsx(Heading,{level:`2`,id:`host-and-port`,children:`Host and Port`}),`\n`,_jsx(Heading,{level:`3`,id:`request-host`,children:`request.host`}),`\n`,_jsx(_components.p,{children:`The hostname part of the URL.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`api.example.com`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-port`,children:`request.port`}),`\n`,_jsx(_components.p,{children:`The port number.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`8080`}),`, `,_jsx(_components.code,{children:`443`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-baseurl`,children:`request.baseUrl`}),`\n`,_jsx(_components.p,{children:`The full URL up to the start of the path, including scheme, host, and port.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`https://api.example.com:8080`})]}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(Heading,{level:`3`,id:`request-headers-key`,children:`request.headers.key`}),`\n`,_jsx(_components.p,{children:`First value of a request header. Header names are case-insensitive.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.headers.X-Request-Id`}),` or `,_jsx(_components.code,{children:`request.headers.Content-Type`})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Referencing a header in this manner will return a list of values, but as a convenience only the first will be printed.\nAs a general rule if you wish to use the first (or only) value of a header in a further expression rather than printing it,\nit is necessary to reference it by index explicitly as shown below e.g. `,_jsx(_components.code,{children:`request.headers.X-Proxied-Via.[0]`})]})}),`\n`,_jsx(Heading,{level:`3`,id:`request-headers-key-2`,children:`request.headers.[key]`}),`\n`,_jsx(_components.p,{children:`Alternative syntax for headers with special characters that aren’t valid in property names.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.headers.[$?blah]`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-headers-key-n`,children:`request.headers.key.[n]`}),`\n`,_jsx(_components.p,{children:`nth value of a header (zero-indexed), for headers with multiple values.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.headers.Accept.[1]`})]}),`\n`,_jsx(Heading,{level:`2`,id:`cookies`,children:`Cookies`}),`\n`,_jsx(Heading,{level:`3`,id:`request-cookies-key`,children:`request.cookies.key`}),`\n`,_jsx(_components.p,{children:`First value of a request cookie.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.cookies.JSESSIONID`})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Referencing a cookie in this manner will return a list of values, but as a convenience only the first will be printed.\nAs a general rule if you wish to use the first (or only) value of a cookie in a further expression rather than printing it,\nit is necessary to reference it by index explicitly as shown below e.g. `,_jsx(_components.code,{children:`request.cookies.X-Proxied-Via.[0]`})]})}),`\n`,_jsx(Heading,{level:`3`,id:`request-cookies-key-n`,children:`request.cookies.key.[n]`}),`\n`,_jsx(_components.p,{children:`nth value of a cookie (zero-indexed), for cookies with multiple values.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.cookies.tracking.[2]`})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(Heading,{level:`3`,id:`request-body-2`,children:`request.body`}),`\n`,_jsx(_components.p,{children:`The request body as text. Avoid using this for binary content.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` For JSON request body, `,_jsx(_components.code,{children:`request.body`}),` contains the raw JSON string`]}),`\n`,_jsx(Heading,{level:`3`,id:`request-bodyasbase64`,children:`request.bodyAsBase64`}),`\n`,_jsx(_components.p,{children:`The Base64-encoded representation of the request body. Use this for binary content.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-identity`,children:`Request Identity`}),`\n`,_jsx(Heading,{level:`3`,id:`request-id`,children:`request.id`}),`\n`,_jsx(_components.p,{children:`A random UUID assigned by WireMock Cloud to every request. Useful for correlation and debugging.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`a3c5e8f2-4b1d-4e9a-8f7c-2d1e3b4a5c6d`})]}),`\n`,_jsx(Heading,{level:`2`,id:`multipart-requests`,children:`Multipart Requests`}),`\n`,_jsx(Heading,{level:`3`,id:`request-multipart`,children:`request.multipart`}),`\n`,_jsx(_components.p,{children:`Boolean indicating whether the request is a multipart request.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-parts`,children:`request.parts`}),`\n`,_jsx(_components.p,{children:`For multipart requests, the individual parts are exposed via the template model. Each part can be referenced by its name and exposes several properties.`}),`\n`,_jsxs(_components.p,{children:[`For a multipart request with a part named `,_jsx(_components.code,{children:`text`}),`, the following properties are available:`]}),`\n`,_jsx(Heading,{level:`4`,id:`request-parts-text-binary`,children:`request.parts.text.binary`}),`\n`,_jsx(_components.p,{children:`Boolean indicating if the part contains binary data.`}),`\n`,_jsx(Heading,{level:`4`,id:`request-parts-text-headers-key`,children:`request.parts.text.headers.key`}),`\n`,_jsx(_components.p,{children:`First value of a header within the multipart part.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`request.parts.text.headers.content-type`})]}),`\n`,_jsx(Heading,{level:`4`,id:`request-parts-text-body`,children:`request.parts.text.body`}),`\n`,_jsx(_components.p,{children:`The part’s body content as text.`}),`\n`,_jsx(Heading,{level:`4`,id:`request-parts-text-bodyasbase64`,children:`request.parts.text.bodyAsBase64`}),`\n`,_jsx(_components.p,{children:`The part’s body content as Base64-encoded string.`}),`\n`,_jsx(Heading,{level:`2`,id:`values-that-can-be-one-or-many`,children:`Values That Can Be One or Many`}),`\n`,_jsx(_components.p,{children:`A number of HTTP elements (query parameters, form fields, headers, cookies) can be single or multiple valued. The template request model handles this elegantly with a “list or single” type that:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Returns the first (and often only) value when no index is specified`}),`\n`,_jsx(_components.li,{children:`Supports indexed access for multiple values`}),`\n`,_jsxs(_components.li,{children:[`Provides convenience accessors like `,_jsx(_components.code,{children:`first`}),` and `,_jsx(_components.code,{children:`last`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`accessing-single-or-multiple-values`,children:`Accessing Single or Multiple Values`}),`\n`,_jsxs(_components.p,{children:[`Given a request URL like `,_jsx(_components.code,{children:`/multi-query?things=1\u0026things=2\u0026things=3`}),`, you can extract query data in several ways:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`handlebars`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`handlebars`,children:_jsxs(_components.code,{language:`handlebars`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things.0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things.first`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things.1`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`-1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request.query.things.last`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` // Returns: 3`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`important-note-about-comparisons`,children:`Important Note About Comparisons`}),`\n`,_jsxs(_components.p,{children:[`When using the `,_jsx(_components.code,{children:`eq`}),` helper with one-or-many values, you must use the indexed form, even if only one value is present.`]}),`\n`,_jsx(_components.p,{children:`The non-indexed form returns the wrapper type (not a String), which will fail comparisons with String values.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Correct:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`handlebars`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`handlebars`,children:_jsxs(_components.code,{language:`handlebars`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`eq`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` request.query.status.0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Status is active`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`/if`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Incorrect:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`handlebars`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`handlebars`,children:_jsxs(_components.code,{language:`handlebars`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`eq`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` request.query.status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` This will not work as expected`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`{{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`/if`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`}}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`using-the-request-model-in-webhooks`,children:`Using the Request Model in Webhooks`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.a,{href:`/webhooks`,children:`webhook`}),` templates, the triggering request is available as `,_jsx(_components.code,{children:`originalRequest`}),` instead of `,_jsx(_components.code,{children:`request`}),`. This distinguishes it from any request data being constructed for the webhook itself.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`{{originalRequest.headers.X-Correlation-Id}}`})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Request Model Reference","description":"Complete reference for accessing request data in templates","sidebarTitle":"Request Model","href":"/response-templating/request-model"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The Request Object","slug":"the-request-object","depth":2,"children":[]},{"title":"URL Attributes","slug":"url-attributes","depth":2,"children":[{"title":"request.url","slug":"request-url","depth":3,"children":[]},{"title":"request.path","slug":"request-path","depth":3,"children":[]},{"title":"request.path.[n]","slug":"request-path-n","depth":3,"children":[]}]},{"title":"Query Parameters","slug":"query-parameters","depth":2,"children":[{"title":"request.query.key","slug":"request-query-key","depth":3,"children":[]},{"title":"request.query.key.[n]","slug":"request-query-key-n","depth":3,"children":[]}]},{"title":"HTTP Method and Protocol","slug":"http-method-and-protocol","depth":2,"children":[{"title":"request.method","slug":"request-method","depth":3,"children":[]},{"title":"request.scheme","slug":"request-scheme","depth":3,"children":[]}]},{"title":"Host and Port","slug":"host-and-port","depth":2,"children":[{"title":"request.host","slug":"request-host","depth":3,"children":[]},{"title":"request.port","slug":"request-port","depth":3,"children":[]},{"title":"request.baseUrl","slug":"request-baseurl","depth":3,"children":[]}]},{"title":"Headers","slug":"headers","depth":2,"children":[{"title":"request.headers.key","slug":"request-headers-key","depth":3,"children":[]},{"title":"request.headers.[key]","slug":"request-headers-key-2","depth":3,"children":[]},{"title":"request.headers.key.[n]","slug":"request-headers-key-n","depth":3,"children":[]}]},{"title":"Cookies","slug":"cookies","depth":2,"children":[{"title":"request.cookies.key","slug":"request-cookies-key","depth":3,"children":[]},{"title":"request.cookies.key.[n]","slug":"request-cookies-key-n","depth":3,"children":[]}]},{"title":"Request Body","slug":"request-body","depth":2,"children":[{"title":"request.body","slug":"request-body-2","depth":3,"children":[]},{"title":"request.bodyAsBase64","slug":"request-bodyasbase64","depth":3,"children":[]}]},{"title":"Request Identity","slug":"request-identity","depth":2,"children":[{"title":"request.id","slug":"request-id","depth":3,"children":[]}]},{"title":"Multipart Requests","slug":"multipart-requests","depth":2,"children":[{"title":"request.multipart","slug":"request-multipart","depth":3,"children":[]},{"title":"request.parts","slug":"request-parts","depth":3,"children":[]},{"title":"request.parts.text.binary","slug":"request-parts-text-binary","depth":4,"children":[]},{"title":"request.parts.text.headers.key","slug":"request-parts-text-headers-key","depth":4,"children":[]},{"title":"request.parts.text.body","slug":"request-parts-text-body","depth":4,"children":[]},{"title":"request.parts.text.bodyAsBase64","slug":"request-parts-text-bodyasbase64","depth":4,"children":[]}]},{"title":"Values That Can Be One or Many","slug":"values-that-can-be-one-or-many","depth":2,"children":[{"title":"Accessing Single or Multiple Values","slug":"accessing-single-or-multiple-values","depth":3,"children":[]},{"title":"Important Note About Comparisons","slug":"important-note-about-comparisons","depth":3,"children":[]}]},{"title":"Using the Request Model in Webhooks","slug":"using-the-request-model-in-webhooks","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/wiremockinc/029d9f60e6edd2c0/scripts/generate-llms-txt.js"],"subdomain":"wiremockinc","siteName":"WireMock Cloud","title":"Request Model Reference - WireMock Cloud","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-26T11:00:12.331Z","originalFileLocation":"response-templating/request-model.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Complete reference for accessing request data in templates\">\u003cmeta data-mint-head name=\"application-name\" content=\"WireMock Cloud\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Request Model Reference - WireMock Cloud\">\u003cmeta data-mint-head property=\"og:description\" content=\"Complete reference for accessing request data in templates\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"WireMock Cloud\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.wiremock.io/response-templating/request-model\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://wiremockinc.mintlify.site/_mintlify/api/og/v2?division=Templating\u0026amp;title=Request+Model+Reference\u0026amp;description=Complete+reference+for+accessing+request+data+in+templates\u0026amp;theme=bd6b655a49d3bdf06e9a283b\u0026amp;signature=eeffc81175c231b0fc08cff2b8fdafe19bc560452847ae5e448ae2e599e140b2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Request Model Reference - WireMock Cloud\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Complete reference for accessing request data in templates\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://wiremockinc.mintlify.site/_mintlify/api/og/v2?division=Templating\u0026amp;title=Request+Model+Reference\u0026amp;description=Complete+reference+for+accessing+request+data+in+templates\u0026amp;theme=bd6b655a49d3bdf06e9a283b\u0026amp;signature=eeffc81175c231b0fc08cff2b8fdafe19bc560452847ae5e448ae2e599e140b2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/wiremockinc/CECzM-LCKYF2F3LU/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"WireMock Cloud\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#234E69\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.wiremock.io/response-templating/request-model\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/response-templating/request-model.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.wiremock.io/#organization\",\"name\":\"WireMock Cloud\",\"url\":\"https://docs.wiremock.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/wiremockinc/naAVdBHezo3uA-vt/logo/light.svg?fit=max\u0026auto=format\u0026n=naAVdBHezo3uA-vt\u0026q=85\u0026s=d793ceace787ddb9b53e3a8e828b9635\"},\"sameAs\":[\"https://wiremock.org\",\"https://www.wiremock.io\",\"https://slack.wiremock.org/\",\"https://x.com/wiremockorg\",\"https://github.com/wiremock\",\"https://www.linkedin.com/company/wiremock/\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.wiremock.io#website\",\"name\":\"WireMock Cloud\",\"url\":\"https://docs.wiremock.io\",\"publisher\":{\"@id\":\"https://docs.wiremock.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.wiremock.io/response-templating/request-model#webpage\",\"url\":\"https://docs.wiremock.io/response-templating/request-model\",\"name\":\"Request Model Reference\",\"description\":\"Complete reference for accessing request data in templates\",\"dateModified\":\"2026-01-26T11:00:12.331Z\",\"isPartOf\":{\"@id\":\"https://docs.wiremock.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.wiremock.io/response-templating/request-model#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.wiremock.io/response-templating/request-model#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://docs.wiremock.io/keyboard-shortcuts\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Templating\",\"item\":\"https://docs.wiremock.io/response-templating/helper-reference\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Request Model Reference\",\"item\":\"https://docs.wiremock.io/response-templating/request-model\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.wiremock.io/response-templating/request-model#article\",\"headline\":\"Request Model Reference\",\"name\":\"Request Model Reference\",\"description\":\"Complete reference for accessing request data in templates\",\"url\":\"https://docs.wiremock.io/response-templating/request-model\",\"mainEntityOfPage\":{\"@id\":\"https://docs.wiremock.io/response-templating/request-model#webpage\"},\"dateModified\":\"2026-01-26T11:00:12.331Z\",\"publisher\":{\"@id\":\"https://docs.wiremock.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.wiremock.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"WireMock Cloud\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"WireMock Cloud","nav":{"global":{"anchors":[{"anchor":"Slack community","icon":"slack","href":"https://slack.wiremock.org"},{"anchor":"Blog","icon":"newspaper","href":"https://wiremock.io/blog"},{"anchor":"Install With Cursor","icon":"robot","href":"cursor://anysphere.cursor-deeplink/mcp/install?name=WireMock\u0026config=eyJjb21tYW5kIjoid2lyZW1vY2sgbWNwIn0="},{"anchor":"Self-paced Training","icon":"pen","href":"https://wiremockcloud.learnworlds.com/"},{"anchor":"Change Log","icon":"newspaper","href":"https://changes.wiremock.io/"},{"anchor":"System Status","icon":"bell","href":"https://status.wiremock.io/"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Concepts","pages":[{"title":"Overview of API simulation with WireMock Cloud","href":"/overview"},{"title":"Stubbing","href":"/concepts/stubbing"},{"title":"Templating","href":"/concepts/templating"},{"group":"Stateful Simulation","pages":[{"title":"Stateful Mocking and Scenarios","sidebarTitle":"Simple Scenarios","href":"/dynamic-state/stateful-scenarios"},{"title":"Dynamic State Basics","sidebarTitle":"Advanced Dynamic State","href":"/dynamic-state/overview"}]},{"title":"Deployment","href":"/concepts/deployment"},{"title":"WireMock Runner","href":"/concepts/runner"},{"title":"Profiles","href":"/concepts/profiles"},{"title":"WireMock Cloud vs other API mocking tools","sidebarTitle":"Comparison","href":"/concepts/comparison"},{"title":"API Security Overview","sidebarTitle":"Security","href":"/security/security"},{"group":"Audit","pages":[{"title":"Audit Events Overview","sidebarTitle":"Overview","href":"/audit-events/overview"},{"title":"Audit Event Destinations - Plan Limits","sidebarTitle":"Plan Limits","href":"/audit-events/plan-limits"}]},{"group":"Versioning","pages":[{"title":"Versioning","sidebarTitle":"Overview","href":"/versioning/overview"},{"title":"Versioning - Plan Limits","sidebarTitle":"Plan Limits","href":"/versioning/plan-limits"}]},{"title":"WireMock Cloud AI","sidebarTitle":"AI and MCP","href":"/ai-mcp/ai-101"}]},{"group":"Tutorials","pages":[{"title":"Exploratory Testing With Spring Boot","sidebarTitle":"Exploratory Testing With Spring Boot","href":"/samples/exploratory-testing-tutorial"},{"title":"Automated Testing with Java","sidebarTitle":"Automated Testing With Java","href":"/samples/automated-testing-with-java"},{"title":"How to build a mock REST API [Tutorial]","sidebarTitle":"Rest API Example","href":"/samples/mock-rest-api"}]},{"group":"How-to Guides","pages":[{"group":"Simulating APIs","expanded":false,"pages":[{"title":"Simulating SOAP services","sidebarTitle":"SOAP","href":"/soap-stubbing"},{"title":"Simulating gRPC services","sidebarTitle":"gRPC","href":"/grpc/overview"},{"title":"Simulating GraphQL APIs","sidebarTitle":"GraphQL","href":"/graphql/overview"},{"title":"Simulating federated GraphQL APIs","sidebarTitle":"Federated GraphQL","href":"/graphql/federation"}]},{"group":"Stubbing","expanded":false,"pages":[{"title":"Stubbing Basics","sidebarTitle":"Overview","href":"/stubbing"},{"title":"Advanced Stubbing","sidebarTitle":"Advanced Stubbing","href":"/advanced-stubbing"},{"title":"Dynamic Responses with Templates","sidebarTitle":"Dynamic Responses","href":"/response-templating/basics"},{"title":"Using a JWT from the Request in a Response Template","sidebarTitle":"Using JWT Claims from a Request","href":"/response-templating/using-jwt-claims-from-request"},{"title":"Serving a Default Response","sidebarTitle":"Default Responses","href":"/default-responses"},{"title":"How to Configure Webhooks and Callbacks","sidebarTitle":"Webhooks and Callbacks","href":"/webhooks"},{"title":"Proxying","sidebarTitle":"Proxying Requests","href":"/proxying"}]},{"group":"Performance","expanded":false,"pages":[{"title":"Response Delays","sidebarTitle":"Response Delays","href":"/delays"},{"title":"User Configurable Rate Limits","sidebarTitle":"Configuring Rate Limits","href":"/user-rate-limits"}]},{"group":"Faults and Chaos","expanded":false,"pages":[{"title":"Simulating Faults","sidebarTitle":"Simulating Faults","href":"/simulating-faults"},{"title":"Chaos settings - Basics","sidebarTitle":"Chaos Testing","href":"/chaos"}]},{"group":"Data Sources","pages":[{"title":"Data Sources - Using External Test Data","sidebarTitle":"Data Sources Overview","href":"/data-sources/overview"},{"title":"Creating \u0026 Editing CSV Data Sources","sidebarTitle":"Managing Data Sources - CSV","href":"/data-sources/managing-csv-data-sources"},{"title":"Creating \u0026 Editing Database Data Sources","sidebarTitle":"Managing Data Sources - Database","href":"/data-sources/managing-database-data-sources"},{"title":"Deleting Data Sources","sidebarTitle":"Deleting Data Sources","href":"/data-sources/deleting-data-sources"},{"title":"Managing Database Connections","sidebarTitle":"Managing Database Connections","href":"/data-sources/managing-database-connections"},{"title":"Sharing Data Sources","sidebarTitle":"Sharing Data Sources","href":"/data-sources/sharing-data-sources"},{"title":"Data Sources - Plan Limits","sidebarTitle":"Plan Limits","href":"/data-sources/plan-limits"}]},{"group":"Recording","expanded":false,"pages":[{"title":"Recording via the Cloud","href":"/recording-stubs"},{"title":"Recording via the CLI","href":"/cli/recording"},{"title":"Multi-domain recording using the WireMock CLI","sidebarTitle":"Multi domain recording with the CLI","href":"/cli/multi-domain-recording"},{"title":"Non-interactive Recording Sessions","sidebarTitle":"Non-Interactive Recording","href":"/cli/non-interactive-recording"}]},{"group":"OpenAPI","pages":[{"title":"OpenAPI Mocking and Prototyping","sidebarTitle":"Working With OpenAPI","href":"/openAPI/openapi"},{"title":"Import \u0026 Export - Swagger and OpenAPI","sidebarTitle":"Import OpenAPI","href":"/openAPI/swagger"},{"title":"OpenAPI Git Integration","sidebarTitle":"Syncing With Git","href":"/openAPI/openapi-git-integration"},{"title":"OpenAPI Validation","sidebarTitle":"OpenAPI Validation","href":"/openAPI/openapi-validation"}]},{"group":"Stateful Mocking","pages":[{"title":"Stateful Mocking and Scenarios","sidebarTitle":"Simple Scenarios","href":"/dynamic-state/stateful-scenarios"},{"title":"Dynamic State Shopping Basket Example","sidebarTitle":"Shopping Cart Example","href":"/dynamic-state/basket-example"},{"title":"Dynamic State - Plan Limits","sidebarTitle":"Plan Limits","href":"/dynamic-state/plan-limits"},{"title":"Create Stateful Endpoint Set","sidebarTitle":"Create Stateful Set","href":"/dynamic-state/create-stateful-set"}]},{"group":"Importing And Exporting","pages":[{"title":"Import \u0026 Export - Overview","sidebarTitle":"Basics","href":"/import-export/overview"},{"title":"Import \u0026 Export - WireMock","sidebarTitle":"Importing via WireMock OSS","href":"/import-export/wiremock"},{"title":"Import \u0026 Export - Postman","sidebarTitle":"Importing via Postman","href":"/import-export/postman"},{"title":"Import \u0026 Export - Via the API","sidebarTitle":"Importing via API","href":"/import-export/api"},{"title":"Importing Via HAR","href":"/import-export/har"},{"title":"Import \u0026 Export - Mountebank","sidebarTitle":"Importing via Mountebank","href":"/import-export/mountebank"}]},{"group":"CLI","pages":[{"title":"WireMock CLI","sidebarTitle":"Installation and basic usage","href":"/cli/overview"},{"title":"Configuring the WireMock CLI","sidebarTitle":"Configuring the CLI","href":"/cli/config"},{"title":"Managing Mock APIs with the CLI","sidebarTitle":"Managing Mock APIs","href":"/cli/mock-apis"},{"title":"Running Mock APIs Locally","href":"/cli/local-playback"},{"title":"Pushing and Pulling Documents","href":"/cli/push-pull"},{"title":"Pushing and Pulling Mock API","href":"/cli/push-pull-mock-api"},{"title":"Importing into WireMock Cloud","href":"/cli/import"},{"title":"Managing Environments with the CLI","sidebarTitle":"Managing Environments","href":"/cli/environments"},{"title":"Syncing API Templates with the CLI","sidebarTitle":"API Templates","href":"/cli/templates"},{"title":"Managing Data Sources with the CLI","sidebarTitle":"Data Sources","href":"/cli/data-sources"}]},{"group":"Runner","pages":[{"title":"WireMock Runner","sidebarTitle":"Installation and basic usage","href":"/runner/overview"},{"title":"Record Many Mode via the WireMock Runner","sidebarTitle":"Record Many Mode","href":"/runner/record-many"},{"title":"Serve Mode via the WireMock Runner","sidebarTitle":"Serve Mode","href":"/runner/serve"},{"title":"WireMock Runner Serve Mode Extensions","sidebarTitle":"Serve Mode Extensions","href":"/runner/serve-mode-extensions"},{"title":"Running the WireMock Runner on Kubernetes","sidebarTitle":"Running on Kubernetes","href":"/runner/running-on-kubernetes"},{"title":"Recording from Within Kubernetes","sidebarTitle":"Recording on Kubernetes","href":"/runner/recording-multiple-apis-on-kubernetes"},{"title":"Promoting Mock APIs with Git and CI/CD","sidebarTitle":"Git and CI/CD Promotion","href":"/runner/promoting-apis-with-git-and-ci"}]},{"group":"Security","pages":[{"title":"Teams and Collaboration","href":"/security/teams-and-collaboration"},{"title":"The SAML Identity Provider Mock","sidebarTitle":"SAML IDP","href":"/security/saml-idp-mock"},{"title":"Key management","sidebarTitle":"Key Management","href":"/security/key-management"}]},{"group":"Audit","pages":[{"title":"Working with Audit Event JSON","sidebarTitle":"Working With Audit Events","href":"/audit-events/working-with-audit-events"}]},{"group":"AI/MCP","pages":[{"title":"WireMock Cloud agent skills","href":"/ai-mcp/agent-skills"},{"title":"Installing the agent skills plugin","href":"/ai-mcp/installation"},{"title":"Installing the local agent skills plugin","href":"/ai-mcp/local-installation"},{"title":"Installing the WireMock Cloud MCP server directly","href":"/ai-mcp/mcp-installation"},{"title":"HTTP Request Authentication","href":"/ai-mcp/http-request-authentication"}]},{"group":"WireMock Cloud API","pages":[{"title":"Getting Started with the API","href":"/api-getting-started"},{"title":"Authentication","href":"/authentication"},{"title":"WireMock API Device Authorization Flow","href":"/device-authorization-flow"},{"title":"Product Usage Data","href":"/usage"},{"title":"Organisation Info and Members","href":"/organisation-info-and-members"},{"title":"Managing Teams and Members","href":"/teams-and-members"},{"title":"User Info","href":"/user-info"},{"title":"Mock APIs","href":"/mock-apis"}]},{"group":"IDE Integrations","pages":[{"group":"JetBrains IDEs","pages":[{"title":"Integration with WireMock Cloud","sidebarTitle":"WireMock Cloud integration","href":"/ide-integrations/jetbrains/wiremock-cloud-integration"},{"title":"Support for WireMock OSS","sidebarTitle":"OSS Support","href":"/ide-integrations/jetbrains/oss-features"},{"title":"Integration with Claude Code","sidebarTitle":"Claude Code integration","href":"/ide-integrations/jetbrains/claude-code-integration"}]}]}]},{"group":"Reference","pages":[{"title":"Keyboard shortcuts","href":"/keyboard-shortcuts"},{"group":"Request Matching","pages":[{"title":"Request Matching - Overview of Matcher Types","sidebarTitle":"Matcher Types","href":"/request-matching/matcher-types"},{"title":"Request Matching - Matching JSON requests","sidebarTitle":"Matching JSON","href":"/request-matching/json"},{"title":"Request Matching - Matching URLs","href":"/request-matching/url"},{"title":"Request Matching - Matching XML bodies","sidebarTitle":"Matching XML","href":"/request-matching/xml"},{"title":"Request Matching – Expression Matcher","sidebarTitle":"Expression Matcher","href":"/request-matching/expression-matcher"}]},{"group":"Templating","pages":[{"title":"Response Templating - Helper Reference","description":"Complete reference of all available Handlebars helpers","sidebarTitle":"Helper Reference","href":"/response-templating/helper-reference"},{"title":"Request Model Reference","sidebarTitle":"Request Model","href":"/response-templating/request-model"},{"title":"Response Templating - Conditional Logic and Iteration","description":"Working with if statements, loops and collections.","sidebarTitle":"Conditional Logic","href":"/response-templating/conditional-logic-and-iteration"},{"title":"Response Templating - Dates and Times","sidebarTitle":"Date And Times","href":"/response-templating/dates-and-times"},{"title":"Response Templating - Working with JSON","sidebarTitle":"JSON And JSONPath","href":"/response-templating/json"},{"title":"Response Templating - JSON Web Tokens (JWT)","sidebarTitle":"JWT Web Tokens","href":"/response-templating/jwt"},{"title":"Response Templating - Cryptographic Helpers","sidebarTitle":"Cryptographic Helpers","href":"/response-templating/cryptographic-helpers"},{"title":"Response Templating - Miscellaneous Helpers","sidebarTitle":"Miscellaneous Helpers","href":"/response-templating/misc-helpers"},{"title":"Response Templating - Naughty Strings","sidebarTitle":"Naughty Strings","href":"/response-templating/naughty-strings"},{"title":"Response Templating - Number Helpers","sidebarTitle":"Number Helpers","href":"/response-templating/number-helpers"},{"title":"Response Templating - Random Faker","sidebarTitle":"Generate Test Data","href":"/response-templating/random-faker"},{"title":"Response Templating - Random Values","sidebarTitle":"Generate Random Values","href":"/response-templating/random-values"},{"title":"Response Templating - String Encodings","sidebarTitle":"String Encodings","href":"/response-templating/string-encodings"},{"title":"Response Templating - String Helpers","sidebarTitle":"String Helpers","href":"/response-templating/string-helpers"},{"title":"Response Templating - Working with XML","sidebarTitle":"XML","href":"/response-templating/xml"}]},{"group":"AI/MCP","expanded":false,"pages":[{"title":"MCP Tools","href":"/ai-mcp/mcp-tools"}]},{"group":"Runner / CLI","expanded":false,"pages":[{"title":"CLI Command Reference","sidebarTitle":"Command reference","href":"/cli/command-reference"},{"title":"wiremock.yaml Configuration Reference","sidebarTitle":"wiremock.yaml Reference","href":"/cli/wiremock-yaml-reference"},{"title":"Import \u0026 Recording Configuration Reference","href":"/cli/recording-configuration"},{"title":"Runner environment variables","sidebarTitle":"Environment variables","href":"/runner/environment-variables"}]}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Request Model Reference - WireMock Cloud","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":[],"chunks":[]}