{"id":625,"date":"2016-02-15T14:06:27","date_gmt":"2016-02-15T14:06:27","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=625"},"modified":"2023-06-22T21:21:51","modified_gmt":"2023-06-22T21:21:51","slug":"how-to-use-header-presets-to-reuse-set-of-headers-for-future-load-tests-2","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2016\/02\/how-to-use-header-presets-to-reuse-set-of-headers-for-future-load-tests-2","title":{"rendered":"How to use Header Presets to Reuse Set of Headers for Future Load Tests"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span><p class=\"lead\"><!-- pn-tldr --><\/p>\n<h2>Key takeaways<\/h2>\n<ul>\n<li>Header presets stop you re-entering auth and content-type headers on every test.<\/li>\n<li>Keep a preset per environment so a test cannot accidentally target the wrong one.<\/li>\n<li>Update the preset rather than individual tests when an API changes.<\/li>\n<\/ul>\n<p><!-- \/pn-tldr -->We&#8217;ve implemented the Header Presets functionality in order to save time and reused same set of headers for future load tests.<\/p>\n<p>The\u00a0steps on how to use the Header Presets are described below:<\/p>\n<ul>\n<li>Under the URL section click on the Headers button<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"248\" class=\"aligncenter size-full wp-image-617\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_1.png\" alt=\"url_header_presets_1\" \/><\/li>\n<li>Click &#8220;Manage Presets&#8221; button and Popup appears with the list of current presets (empty at the beginning)<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"230\" class=\"aligncenter size-medium wp-image-618\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_2.png\" alt=\"url_header_presets_2\" \/><\/li>\n<li>Click &#8220;Add&#8221; button to add new presets<\/li>\n<li>\u00a0New\u00a0Presets popup appears\n<ul>\n<li>Select a name for the current set of headers presets<\/li>\n<li>Start adding key\/value pairs for the current preset<\/li>\n<li>Click &#8220;Submit&#8221; when finished adding all the key\/value pairs<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"386\" class=\"aligncenter size-medium wp-image-619\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_3.png\" alt=\"url_header_presets_3\" \/><\/li>\n<li>The new preset will be visible in the Manage Presets popup<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"281\" class=\"aligncenter size-medium wp-image-620\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_4.png\" alt=\"url_header_presets_4\" \/><\/li>\n<li>If you want to edit the current preset, just click on the preset name and edit the preset (names and values)<\/li>\n<li>Close the &#8220;Manage Presets&#8221; popup and the presets dropdown will be populated with all created presets<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"245\" class=\"aligncenter size-medium wp-image-621\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_5.png\" alt=\"url_header_presets_5\" \/><\/li>\n<li>Now just select the desired preset and the Headers will get populated with the values from the preset<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"293\" class=\"aligncenter size-medium wp-image-622\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/url_header_presets_6.png\" alt=\"url_header_presets_6\" \/><\/li>\n<li>You can click on any preset in the dropdown, the values will append to the existing ones<\/li>\n<\/ul>\n<p>Use the headers for load testing websites or APIs with custom headers.<\/p>\n<p>Hope this helps is making LoadFocus a better and easier load testing service and your choice for\u00a0the\u00a0<a href=\"https:\/\/loadfocus.com\/load-testing\">load testing tool<\/a> to use.<\/p>\n<p><a title=\"website load testing\" href=\"https:\/\/loadfocus.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">LoadFocus<\/a> is a Cloud Testing Platform used for Load and Performance Testing for Websites and APIs\u00a0and\u00a0Website Speed Testing with Analytics.<!-- pn-faq --><\/p>\n<h2>Frequently Asked Questions<\/h2>\n<h3>What problem do header presets solve?<\/h3>\n<p>Re-entering the same authorisation and content-type headers on every new test. Saving them once removes a step that is easy to get subtly wrong when typed repeatedly.<\/p>\n<h3>Should I keep one preset or several?<\/h3>\n<p>One per environment. A single shared preset is how a test ends up pointed at the wrong environment with credentials that happen to work there.<\/p>\n<h3>What happens when the API changes?<\/h3>\n<p>Update the preset rather than each test. That is the point of having it: one edit propagates instead of leaving a few old tests quietly sending stale headers.<\/p>\n<p><!-- \/pn-faq --><!-- pn-related-reading --><\/p>\n<h2>Related reading<\/h2>\n<ul>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2013\/07\/apache-jmeter-performance-test-introduction\">Introduction to Apache JMeter Performance Testing<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span>Key takeaways Header presets stop you re-entering auth and content-type headers on every test. Keep a preset per environment so a test cannot accidentally target the wrong one. Update the preset rather than individual tests when an API changes. We&#8217;ve implemented the Header Presets functionality in order to save time and reused same set of&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2016\/02\/how-to-use-header-presets-to-reuse-set-of-headers-for-future-load-tests-2\" class=\"more-link\" title=\"Read How to use Header Presets to Reuse Set of Headers for Future Load Tests\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3710,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[479,9],"tags":[],"class_list":["post-625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api-monitoring","category-load-testing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/comments?post=625"}],"version-history":[{"count":4,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/625\/revisions"}],"predecessor-version":[{"id":2640,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/625\/revisions\/2640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/3710"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}