{"id":31655,"date":"2024-07-03T14:04:05","date_gmt":"2024-07-03T19:04:05","guid":{"rendered":"https:\/\/wpengine.com\/builders\/?p=31655"},"modified":"2024-07-03T14:04:08","modified_gmt":"2024-07-03T19:04:08","slug":"request-headers-in-headless-wordpress-with-atlas","status":"publish","type":"post","link":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/","title":{"rendered":"Request Headers in headless WordPress with Atlas"},"content":{"rendered":"\n<p><br><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Request_header\">Request headers<\/a> are key-value pairs sent by the client to the server in an HTTP request. They provide additional information about the request, such as the client&#8217;s browser type, preferred language, and other relevant data. Request headers play an important role in enabling the server to understand and process the request appropriately.<\/p>\n\n\n\n<p>In this article, I will guide you through how Atlas, WP Engine&#8217;s headless hosting platform automates request headers to your site.<\/p>\n\n\n\n<div class=\"wp-block-group has-polar-background-color has-background is-layout-flow wp-container-core-group-is-layout-7a03825d wp-block-group-is-layout-flow\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--40)\">\n<p class=\"has-large-font-size\"><strong>Table of Contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"Prerequisites\">\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n\n\n\n<li><a href=\"#the-benefits\">Request Headers in Atla<\/a><a href=\"#request-headers-atlas\">s<\/a><\/li>\n\n\n\n<li><a href=\"#rendering-atlas-geolocation-headers-nextjs-faustjs\">Rendering Atlas Geolocation Headers in Next.js\/Faust.js pages<\/a><\/li>\n\n\n\n<li><a href=\"#best-frameworks-for-headless-wp\">Best Frameworks for Headless WordPress<\/a><\/li>\n\n\n\n<li><a href=\"#deploying-to-atlas\">Deploying to Atlas<\/a><\/li>\n\n\n\n<li><a href=\"#summing-it-all-up\">Conclusio<\/a><a href=\"#conclusion\">n<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Before reading this article, you should have the following prerequisites checked off:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Basic knowledge of <a href=\"http:\/\/next.js\">Next.js<\/a> and <a href=\"http:\/\/faust.js\">Faust.js.<\/a><\/li>\n\n\n\n<li>An Atlas account and environment set up.<\/li>\n\n\n\n<li><a href=\"http:\/\/node.js\">Node.js<\/a> and <a href=\"https:\/\/www.npmjs.com\/\">npm<\/a> are installed on your local machine.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-group has-base-color has-heliotrope-background-color has-text-color has-background has-link-color wp-elements-60580c77f35127ab4c58efd3ae854863 has-global-padding is-layout-constrained wp-container-core-group-is-layout-9b866ece wp-block-group-is-layout-constrained\" style=\"border-radius:12px;margin-bottom:var(--wp--preset--spacing--30);padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\">\n<div class=\"wp-block-group alignwide is-content-justification-left is-layout-flex wp-container-core-group-is-layout-4bb02320 wp-block-group-is-layout-flex\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n<p style=\"font-size:26px;font-style:normal;font-weight:700;letter-spacing:-1px;line-height:1\">Headless<br>Platform<\/p>\n\n\n\n<p class=\"has-small-font-size wp-container-content-9cfa9a5a\" style=\"line-height:1.5\">The all-in-one platform for <br>radically fast headless sites.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-right is-nowrap is-layout-flex wp-container-core-buttons-is-layout-b315634e wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-outline-base\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/wpeng.in\/headless-platform\/\" style=\"border-radius:99px;padding-top:10px;padding-right:24px;padding-bottom:10px;padding-left:24px\" target=\"_blank\" rel=\"noreferrer noopener\">Try for free \u2192<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"request-headers-atlas\">Request Headers in Atlas<\/h2>\n\n\n\n<p>The Atlas headless WordPress hosting platform automatically appends additional request headers to every request made to your site.&nbsp; These headers are designed to provide valuable geographical and temporal information about the request origin, enabling you to tailor content and functionality based on the user\u2019s location and local time.<\/p>\n\n\n\n<p>The headers automatically appended are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>wpe-headless-country<\/strong>: The ISO alpha-2 country code of the request&#8217;s origin.<\/li>\n\n\n\n<li><strong>wpe-headless-region<\/strong>: The region within the country from where the request is made.<\/li>\n\n\n\n<li><strong>wpe-headless-timezone<\/strong>: The timezone of the request origin in TZ Database format.<\/li>\n<\/ul>\n\n\n\n<p>Documentation on Atlas request headers is <a href=\"https:\/\/developers.wpengine.com\/docs\/atlas\/additional-guides\/request-headers\/\">here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Benefits of Geolocation Headers in Atlas<\/h3>\n\n\n\n<p>Geolocation headers offer several advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Personalization<\/strong>: Tailor content and experiences based on the user&#8217;s location.<\/li>\n\n\n\n<li><strong>Localization<\/strong>: Display content in the user&#8217;s local language or relevant to their region.<\/li>\n\n\n\n<li><strong>Analytics<\/strong>: Gather insights into where your users are coming from to better understand your audience.<\/li>\n\n\n\n<li><strong>Compliance<\/strong>: Ensure compliance with regional regulations by adapting content accordingly.<\/li>\n<\/ul>\n\n\n\n<p>This data has several use cases. You could display localized news and weather updates or promote things based on the user\u2019s location. Moreover, you can make custom greetings based on the user\u2019s local time and collect data on user distribution across regions and time zones for better insight and user experience.<\/p>\n\n\n\n<p>Now that we understand request headers and how Atlas automates them, let&#8217;s implement an example of how to display an output of the request headers on a page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"rendering-atlas-geolocation-headers-nextjs-faustjs\">Rendering Atlas Geolocation Headers in Next.js\/Faust.js pages<\/h2>\n\n\n\n<p>For this example, we are going to use Next.js. The code and folder structure\/file structure in the App Router Experimental package in Faust.js work exactly the same.<br><\/p>\n\n\n\n<p>Since we are using Next 14 which defaults to <a href=\"https:\/\/react.dev\/reference\/rsc\/server-components\">React Server Components<\/a>, we can fetch the request headers directly in the page component on the server side.<\/p>\n\n\n\n<p>In the root of the App directory, create a folder called <code>local<\/code> and within that folder, create a file called <code>page.jsx<\/code>.&nbsp; The structure should be: <code>app\/local\/page.jsx<\/code>.&nbsp; Once you have created that, copy and paste this code block into the <code>page.jsx<\/code> file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-keyword\">import<\/span> { headers } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'next\/headers'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-keyword\">async<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">LocalPage<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">const<\/span> country = headers().get(<span class=\"hljs-string\">'wpe-headless-country'<\/span>) || <span class=\"hljs-string\">'No country data'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">const<\/span> region = headers().get(<span class=\"hljs-string\">'wpe-headless-region'<\/span>) || <span class=\"hljs-string\">'No region data'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">const<\/span> timezone = headers().get(<span class=\"hljs-string\">'wpe-headless-timezone'<\/span>) || <span class=\"hljs-string\">'No timezone data'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">return<\/span> (\n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\">      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span>&gt;<\/span>Geolocation Data<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>Country: {country}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>Region: {region}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>Timezone: {timezone}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">  );<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\">}<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><span class=\"hljs-tag\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Let\u2019s break down what the code is doing here.&nbsp; At the top of the file, we import the <code>headers<\/code> function from the <code>next\/headers<\/code> module. This will allow us to access the request headers in this server component.<\/p>\n\n\n\n<p>Next, we define the component, calling it <code>LocalPage<\/code>. This is our async function that renders the page.<\/p>\n\n\n\n<p>Following that, we retrieve the values of all the headers (country, region, timezone). If the headers are not present, the message defaults to stating that there is no data for that header.<\/p>\n\n\n\n<p>Lastly we render the component returning the JSX.&nbsp; The elements on the page will show the geolocation data.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>Once you have added this page file, make sure you push these changes up to your remote repository that is supported by Atlas before deployment.&nbsp; GitHub, Bitbucket, and GitLab are the supported repos.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"deploying-to-atlas\">Deploying to Atlas<\/h2>\n\n\n\n<p>The last step is to connect your remote repo to Atlas, git push any changes, and visit the local page route we made to see the geolocation data. If you have not connected to Atlas yet, please do so. <a href=\"https:\/\/developers.wpengine.com\/docs\/atlas\/getting-started\/create-app\/\">Here are the docs for reference<\/a>.<\/p>\n\n\n\n<p>Once you are deployed and have a live URL, you should have a page called <code>\/local<\/code> that looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-1024x612.png\" alt=\"\" class=\"wp-image-31656\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-1024x612.png 1024w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-300x179.png 300w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-768x459.png 768w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-1536x919.png 1536w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-03-at-9.39.57\u202fAM-2048x1225.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>By leveraging request headers provided by WP Engine&#8217;s Atlas, you can enhance your headless WordPress applications with geolocation data, offer personalized and localized content, gather valuable analytics, and ensure compliance with regional regulations.<\/p>\n\n\n\n<p>As always, we look forward to hearing your feedback, thoughts, and projects so hit us up in our headless <a href=\"https:\/\/discord.com\/invite\/headless-wordpress-836253505944813629\">Discord<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Request headers are key-value pairs sent by the client to the server in an HTTP request. They provide additional information about the request, such as the client&#8217;s browser type, preferred [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-31655","post","type-post","status-publish","format-standard","hentry","category-headless"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Request Headers in headless WordPress with Atlas - Builders<\/title>\n<meta name=\"description\" content=\"Learn how to effectively manage request headers in headless WordPress using WP Engine&#039;s Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Request Headers in Headless WordPress with WP Engine&#039;s Atlas\" \/>\n<meta property=\"og:description\" content=\"Learn how to effectively manage request headers in headless WordPress using WP Engine&#039;s Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/\" \/>\n<meta property=\"og:site_name\" content=\"Builders\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-03T19:04:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-03T19:04:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/WPE-Builders-YouTube-ScreenshotLight-1920x1080-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Francis Agulto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:site\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Francis Agulto\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/\"},\"author\":{\"name\":\"Francis Agulto\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/bcdcb4ac0b215c34b6b30e440a24dc54\"},\"headline\":\"Request Headers in headless WordPress with Atlas\",\"datePublished\":\"2024-07-03T19:04:05+00:00\",\"dateModified\":\"2024-07-03T19:04:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/\"},\"wordCount\":760,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"articleSection\":[\"Headless\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/\",\"name\":\"Request Headers in headless WordPress with Atlas - Builders\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\"},\"datePublished\":\"2024-07-03T19:04:05+00:00\",\"dateModified\":\"2024-07-03T19:04:08+00:00\",\"description\":\"Learn how to effectively manage request headers in headless WordPress using WP Engine's Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/request-headers-in-headless-wordpress-with-atlas\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Request Headers in headless WordPress with Atlas\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"name\":\"Builders\",\"description\":\"Reimagining the way we build with WordPress.\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"width\":348,\"height\":68,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/wpebuilders\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCh1WuL54XFb9ZI6m6goFv1g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/bcdcb4ac0b215c34b6b30e440a24dc54\",\"name\":\"Francis Agulto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"caption\":\"Francis Agulto\"},\"description\":\"Fran Agulto is a Developer Advocate at WP Engine. He is a lover of all things headless WordPress, Rock Climbing, and overall being stoked for people that love what they do and share that stoke with others! Follow me on Twitter for cool stoked headless WP!\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/author\\\/francis-agultowpengine-com-2-2-2-2-2-2-2-2-2-2-2-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Request Headers in headless WordPress with Atlas - Builders","description":"Learn how to effectively manage request headers in headless WordPress using WP Engine's Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/","og_locale":"en_US","og_type":"article","og_title":"Request Headers in Headless WordPress with WP Engine's Atlas","og_description":"Learn how to effectively manage request headers in headless WordPress using WP Engine's Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.","og_url":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/","og_site_name":"Builders","article_published_time":"2024-07-03T19:04:05+00:00","article_modified_time":"2024-07-03T19:04:08+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/07\/WPE-Builders-YouTube-ScreenshotLight-1920x1080-1.png","type":"image\/png"}],"author":"Francis Agulto","twitter_card":"summary_large_image","twitter_creator":"@wpebuilders","twitter_site":"@wpebuilders","twitter_misc":{"Written by":"Francis Agulto","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/"},"author":{"name":"Francis Agulto","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/bcdcb4ac0b215c34b6b30e440a24dc54"},"headline":"Request Headers in headless WordPress with Atlas","datePublished":"2024-07-03T19:04:05+00:00","dateModified":"2024-07-03T19:04:08+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/"},"wordCount":760,"commentCount":0,"publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"articleSection":["Headless"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/","url":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/","name":"Request Headers in headless WordPress with Atlas - Builders","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/#website"},"datePublished":"2024-07-03T19:04:05+00:00","dateModified":"2024-07-03T19:04:08+00:00","description":"Learn how to effectively manage request headers in headless WordPress using WP Engine's Atlas platform. This guide covers what request headers are, how Atlas automates them, and how to render them on Nex.js and Faust.js pages.","breadcrumb":{"@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/builders\/request-headers-in-headless-wordpress-with-atlas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/builders\/"},{"@type":"ListItem","position":2,"name":"Request Headers in headless WordPress with Atlas"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/builders\/#website","url":"https:\/\/wpengine.com\/builders\/","name":"Builders","description":"Reimagining the way we build with WordPress.","publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/builders\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/builders\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/builders\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","width":348,"height":68,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/wpebuilders","https:\/\/www.youtube.com\/channel\/UCh1WuL54XFb9ZI6m6goFv1g"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/bcdcb4ac0b215c34b6b30e440a24dc54","name":"Francis Agulto","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","caption":"Francis Agulto"},"description":"Fran Agulto is a Developer Advocate at WP Engine. He is a lover of all things headless WordPress, Rock Climbing, and overall being stoked for people that love what they do and share that stoke with others! Follow me on Twitter for cool stoked headless WP!","url":"https:\/\/wpengine.com\/builders\/author\/francis-agultowpengine-com-2-2-2-2-2-2-2-2-2-2-2-3\/"}]}},"_links":{"self":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/31655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/comments?post=31655"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/31655\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/media?parent=31655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/categories?post=31655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/tags?post=31655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}