{"id":4039,"date":"2022-09-14T16:11:54","date_gmt":"2022-09-14T16:11:54","guid":{"rendered":"https:\/\/uptime.com\/blog\/?post_type=changelog&#038;p=4039"},"modified":"2022-09-14T16:10:13","modified_gmt":"2022-09-14T16:10:13","slug":"validate-an-http-header-in-the-response-for-an-api-check","status":"publish","type":"changelog","link":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check","title":{"rendered":"Validate an HTTP Header in the Response for an API Check"},"content":{"rendered":"<p>Add a validator step for HTTP Headers, to check whether a specific header does or does not contain either a value or a regex matched value. For example, retrieving the header <b>Server<\/b> from <a href=\"https:\/\/uptime.com\/api\/v1\/auth\/\" target=\"_blank\" rel=\"noopener\">this endpoint<\/a> should be formatted as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4036 size-large\" src=\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png\" alt=\"\" width=\"570\" height=\"273\" srcset=\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png 570w, https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-510x245.png 510w, https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value.png 1070w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/p>\n<p>For more details, see our documentation on <a href=\"https:\/\/support.uptime.com\/hc\/en-us\/articles\/5608610773404-API-Check-Commands-Variables-and-Validators\" target=\"_blank\" rel=\"noopener\">API Check Commands and Validators<\/a> section on <a href=\"https:\/\/support.uptime.com\/hc\/en-us\/articles\/5608610773404-API-Check-Commands-Variables-and-Validators#http_header_validation\" target=\"_blank\" rel=\"noopener\">HTTP Header Validation<\/a>.<\/p>\n","protected":false},"template":"","meta":{"_acf_changed":false},"class_list":["post-4039","changelog","type-changelog","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Uptime.com | Changelog<\/title>\n<meta name=\"description\" content=\"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Uptime.com | Changelog\" \/>\n<meta property=\"og:description\" content=\"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check\" \/>\n<meta property=\"og:site_name\" content=\"Uptime.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/uptimemonitor\" \/>\n<meta property=\"og:image\" content=\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@UptimeDotCom\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check\",\"url\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check\",\"name\":\"Uptime.com | Changelog\",\"isPartOf\":{\"@id\":\"https:\/\/uptime.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage\"},\"image\":{\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage\"},\"thumbnailUrl\":\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png\",\"datePublished\":\"2022-09-14T16:11:54+00:00\",\"description\":\"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.\",\"breadcrumb\":{\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage\",\"url\":\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value.png\",\"contentUrl\":\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value.png\",\"width\":1070,\"height\":513},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/uptime.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Changelog\",\"item\":\"https:\/\/uptime.com\/blog\/changelog\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Validate an HTTP Header in the Response for an API Check\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/uptime.com\/blog\/#website\",\"url\":\"https:\/\/uptime.com\/blog\/\",\"name\":\"Uptime.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/uptime.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/uptime.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/uptime.com\/blog\/#organization\",\"name\":\"Uptime.com\",\"url\":\"https:\/\/uptime.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/uptime.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/10\/Uptime.com_Wordmark_Horizontal_Black_Green.png\",\"contentUrl\":\"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/10\/Uptime.com_Wordmark_Horizontal_Black_Green.png\",\"width\":512,\"height\":83,\"caption\":\"Uptime.com\"},\"image\":{\"@id\":\"https:\/\/uptime.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/uptimemonitor\",\"https:\/\/x.com\/UptimeDotCom\",\"https:\/\/www.linkedin.com\/company\/uptime-com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Uptime.com | Changelog","description":"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.","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:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check","og_locale":"en_US","og_type":"article","og_title":"Uptime.com | Changelog","og_description":"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.","og_url":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check","og_site_name":"Uptime.com","article_publisher":"https:\/\/www.facebook.com\/uptimemonitor","og_image":[{"url":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@UptimeDotCom","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check","url":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check","name":"Uptime.com | Changelog","isPartOf":{"@id":"https:\/\/uptime.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage"},"image":{"@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage"},"thumbnailUrl":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value-570x273.png","datePublished":"2022-09-14T16:11:54+00:00","description":"Uptime.com shares expertise on all things uptime, availabilty, observability, and website monitoring.","breadcrumb":{"@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#primaryimage","url":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value.png","contentUrl":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/09\/header-matches-value.png","width":1070,"height":513},{"@type":"BreadcrumbList","@id":"https:\/\/uptime.com\/blog\/changelog\/validate-an-http-header-in-the-response-for-an-api-check#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/uptime.com\/blog"},{"@type":"ListItem","position":2,"name":"Changelog","item":"https:\/\/uptime.com\/blog\/changelog"},{"@type":"ListItem","position":3,"name":"Validate an HTTP Header in the Response for an API Check"}]},{"@type":"WebSite","@id":"https:\/\/uptime.com\/blog\/#website","url":"https:\/\/uptime.com\/blog\/","name":"Uptime.com","description":"","publisher":{"@id":"https:\/\/uptime.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/uptime.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/uptime.com\/blog\/#organization","name":"Uptime.com","url":"https:\/\/uptime.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uptime.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/10\/Uptime.com_Wordmark_Horizontal_Black_Green.png","contentUrl":"https:\/\/uptime.com\/blog\/wp-content\/uploads\/2022\/10\/Uptime.com_Wordmark_Horizontal_Black_Green.png","width":512,"height":83,"caption":"Uptime.com"},"image":{"@id":"https:\/\/uptime.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/uptimemonitor","https:\/\/x.com\/UptimeDotCom","https:\/\/www.linkedin.com\/company\/uptime-com\/"]}]}},"_links":{"self":[{"href":"https:\/\/uptime.com\/blog\/wp-json\/wp\/v2\/changelog\/4039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uptime.com\/blog\/wp-json\/wp\/v2\/changelog"}],"about":[{"href":"https:\/\/uptime.com\/blog\/wp-json\/wp\/v2\/types\/changelog"}],"wp:attachment":[{"href":"https:\/\/uptime.com\/blog\/wp-json\/wp\/v2\/media?parent=4039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}