{"id":31530,"date":"2018-04-21T15:47:48","date_gmt":"2018-04-21T15:47:48","guid":{"rendered":"https:\/\/ampscript.guide\/httprequestheader\/"},"modified":"2021-04-06T00:58:42","modified_gmt":"2021-04-06T00:58:42","slug":"httprequestheader","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/httprequestheader\/","title":{"rendered":"HTTPRequestHeader"},"content":{"rendered":"<h2>HTTPRequestHeader<\/h2>\n<p>This function returns a specified header from an HTTP request. This function is only available in landing pages, microsites and CloudPages. It cannot be used in other Marketing Cloud applications.<\/p>\n<h3>Argument<\/h3>\n<p><code>HTTPRequestHeader(1)<\/code><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center\">Ordinal<\/th>\n<th style=\"text-align: left\">Type<\/th>\n<th style=\"text-align: left\">Required<\/th>\n<th style=\"text-align: left\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center\">1<\/td>\n<td style=\"text-align: left\">String<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">An HTTP header as defined in <a href=\"https:\/\/tools.ietf.org\/html\/rfc7231\">RFC 7231<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>NOTE: Only headers that are available in the page request return a value. For example, if a user pastes a URL into a web browser instead of clicking on a page hyperlink (from another web page), the <code>Referer<\/code> header value will be empty.<\/p>\n<\/blockquote>\n<h3>Example<\/h3>\n<p>The following example retrieves HTTP headers from a web page session.<\/p>\n<pre><code>%%[\n\nvar @referrer, @userAgent, @host\nset @referrer = HTTPRequestHeader(\"Referer\")\nset @userAgent = HTTPRequestHeader(\"User-Agent\")\nset @host = HTTPRequestHeader(\"Host\")\n\n]%%\nReferrer is %%=v(@referrer)=%%\n&lt;br&gt;&lt;br&gt;User Agent is %%=v(@userAgent)=%%\n&lt;br&gt;&lt;br&gt;Host is %%=v(@host)=%%<\/code><\/pre>\n<h4>Output<\/h4>\n<p>The request will return HTML content from the source URL.<\/p>\n<pre><code>Referrer is https:\/\/mystore.com\/offers\/?pageid=123\n\nUser Agent is Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/64.0.3282.140 Safari\/537.36\n\nHost is pub.s1.exacttarget.com\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTTPRequestHeader This function returns a specified header from an HTTP request. This function is only available in landing pages, microsites and CloudPages. It cannot be used in other Marketing Cloud applications. Argument HTTPRequestHeader(1) Ordinal Type Required Description 1 String True An HTTP header as defined in RFC 7231 NOTE: Only headers that are available in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The AMPscript Guide - HTTPRequestHeader<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ampscript.guide\/httprequestheader\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - HTTPRequestHeader\" \/>\n<meta property=\"og:description\" content=\"HTTPRequestHeader This function returns a specified header from an HTTP request. This function is only available in landing pages, microsites and CloudPages. It cannot be used in other Marketing Cloud applications. Argument HTTPRequestHeader(1) Ordinal Type Required Description 1 String True An HTTP header as defined in RFC 7231 NOTE: Only headers that are available in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/httprequestheader\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-06T00:58:42+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ampscript.guide\/#website\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"The AMPscript Guide\",\"description\":\"The Definitive Scripting Manual for Salesforce Marketing Cloud\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ampscript.guide\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/httprequestheader\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/httprequestheader\/\",\"name\":\"The AMPscript Guide - HTTPRequestHeader\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:48+00:00\",\"dateModified\":\"2021-04-06T00:58:42+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/httprequestheader\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/httprequestheader\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/httprequestheader\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/httprequestheader\/\",\"url\":\"https:\/\/ampscript.guide\/httprequestheader\/\",\"name\":\"HTTPRequestHeader\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\",\"name\":\"dev\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31530"}],"collection":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/comments?post=31530"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31530\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}