{"id":1929,"date":"2022-06-17T06:01:34","date_gmt":"2022-06-17T06:01:34","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/hittingpostrequests-chainrequests-using-postman\/"},"modified":"2022-06-17T06:01:34","modified_gmt":"2022-06-17T06:01:34","slug":"hittingpostrequests-chainrequests-using-postman","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/hittingpostrequests-chainrequests-using-postman\/","title":{"rendered":"HittingPOSTRequests &#038; ChainRequests using Postman"},"content":{"rendered":"<p><html><body><\/p>\n<section class=\"tcb-post-content tcb-shortcode thrv_wrapper\" data-css=\"tve-u-16ec5d248bb\">\n<div class=\"tve_flt tcb-style-wrap\" id=\"tve_flt\">\n<div class=\"tve_shortcode_editor tar-main-content\" data-post-id=\"1929\" id=\"tve_editor\">\n<div class=\"thrv_wrapper tve-toc tve-elem-scroll tve-toc-expandable tcb-local-vars-root\" data-animation=\"slide\" data-animation-speed=\"fast\" data-bullet-style='{\"0\":\"tve-u-62ac18be6539d5\",\"1\":\"tve-u-62ac18be6539e9\",\"2\":\"tve-u-62ac18be653a09\"}' data-columns=\"1\" data-columns-d=\"1\" data-css=\"tve-u-62ac18be6539b3\" data-ct=\"toc-60671\" data-ct-name=\"Table of Contents 03\" data-element-name=\"Table of Contents\" data-headers=\"h1,h3,h4\" data-heading-style='{\"0\":\"tve-u-62ac18be653884\",\"1\":\"tve-u-62ac18be653980\",\"2\":\"tve-u-62ac18be6539a4\"}' data-highlight=\"section\" data-number-style='{\"0\":\"tve-u-62ac18be653a18\",\"1\":\"tve-u-62ac18be653a30\",\"2\":\"tve-u-62ac18be653a57\"}' data-numbering=\"basic\" data-state-default=\"expanded\" data-transition=\"fade\" style=\"\">\n<div class=\"thrive-colors-palette-config\" style=\"display: none !important\"><\/div>\n<div class=\"tve-toc-divider\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\">\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-62ac18be653a78\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<p><svg class=\"toc-icons\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-0\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-1\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-2\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><\/svg><\/p>\n<div class=\"tve-content-box-background\" data-css=\"tve-u-62ac18be653a82\" style=\"\"><\/div>\n<div class=\"thrv_wrapper tve-toc-title show-icon tcb-icon-display tve-no-dropzone tve-prevent-content-edit\" data-css=\"tve-u-62ac18be653a99\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve-toc-title-icon\" data-icon-code=\"icon-arrow-circle-down-solid\" style=\"\"><svg class=\"tcb-icon\" data-id=\"icon-arrow-circle-down-solid\" data-name=\"\" viewbox=\"0 0 512 512\"><path d=\"M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z\"><\/path><\/svg><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve_no_icons\">\n<div class=\"tcb-plain-text\" style=\"\">Table of Contents<\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"tve-cb tve-toc-content tve-prevent-content-edit\">\n<div class=\"thrv_wrapper tve-toc-list tcb-no-delete tcb-no-save tcb-no-clone tve-no-dropzone\" data-css=\"tve-u-62ac18be653ab7\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"tve_ct_content tve_clearfix\">\n<div class=\"ct_column\">\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889007\" jump-animation=\"smooth\">Hitting POST Requests and chain 2 requests using Postman<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889008\" jump-animation=\"smooth\">1. What you will Learn in this blog?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889009\" jump-animation=\"smooth\">2. \u00a0Hit POST request without parameters<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889010\" jump-animation=\"smooth\">3.\u00a0Hit POST request with parameters<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889011\" jump-animation=\"smooth\">4.\u00a0Save the POST Request<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889012\" jump-animation=\"smooth\">5.\u00a0Generate random unique IDs<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889013\" jump-animation=\"smooth\">6.\u00a0Capture static id and use it in another POST request<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac18be653980\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655567889014\" jump-animation=\"smooth\">7.\u00a0Generate random id and use it in another POST request<\/a><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-62ac18be653a78\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655567889007\"><b>Hitting POST Requests and chain 2 requests using Postman<\/b><\/h3>\n<p>Welcome you all to the brand new \u2018API Testing\u2019 blog series! In the previous blog, we had studied how to execute GET requests using Postman. In this tutorial, we will look at POST requests. We will also see how to chain GET and POST requests!! So let us begin!!!\u00a0<\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px auto; text-align: center; display: block; clear: both;\">\n<p><!-- horizontal responsive 2 --><br \/>\n<ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-3231318496783163\" data-ad-format=\"auto\" data-ad-slot=\"2788468763\" data-full-width-responsive=\"true\" style=\"display:block\"><\/ins>\n<\/div>\n<h3 id=\"t-1655567889008\"><b>1. <b>What you will Learn in this blog?<\/b><\/b><\/h3>\n<ul>\n<li>Hit POST request without parameters<\/li>\n<li>Hit POST request with parameters<\/li>\n<li>Save the POST Request<\/li>\n<li>Generate random unique IDs<\/li>\n<li>Capture static id and use it in another POST request<\/li>\n<li>Generate random id and use it in another POST request<\/li>\n<\/ul>\n<h3 id=\"t-1655567889009\"><b>2. <b><\/b><\/b><b>\u00a0<b><\/b><\/b><b><b><b>Hit POST request without parameters<\/b><\/b><\/b><\/h3>\n<p>Let us now look at POST request. See below, we have <b>\/post<\/b> method that we can append with URI<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817798fdd4\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2193\" data-css=\"tve-u-18177993de7\" data-height=\"348\" data-id=\"2193\" data-init-height=\"210\" data-init-width=\"300\" data-width=\"497\" decoding=\"async\" height=\"348\" loading=\"lazy\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-5-300x210.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-5-300x210.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-1-5.jpg 472w\" style=\"\" title=\"Image 1\" width=\"497\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So, let us create a new request, select POST from dropdown, enter the URI and append it with <b>\/post<\/b> as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779a0292\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2194\" data-css=\"tve-u-181779a10f9\" data-height=\"228\" data-id=\"2194\" data-init-height=\"131\" data-init-width=\"300\" data-width=\"523\" decoding=\"async\" height=\"228\" loading=\"lazy\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-5-300x131.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-5-300x131.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-2-5.jpg 431w\" style=\"\" title=\"Image 2\" width=\"523\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Since this is a POST request, we have to send some body (data) as part of this request. When we execute this request, the data will be posted(created) on the server viz a new record will get created on the server side.<\/p>\n<p>To add the body, see below. Go to the \u2018Body\u2019 section, select \u2018raw\u2019 radio button and further select JSON from the dropdown<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779a7d72\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2195\" data-css=\"tve-u-181779a8acf\" data-height=\"121\" data-id=\"2195\" data-init-height=\"66\" data-init-width=\"300\" data-width=\"551\" decoding=\"async\" height=\"121\" loading=\"lazy\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-5-300x66.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-5-300x66.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-3-5.jpg 585w\" style=\"\" title=\"Image 3\" width=\"551\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Add a very simple json body<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779b01a5\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2196\" data-css=\"tve-u-181779b0f7f\" data-height=\"301\" data-id=\"2196\" data-init-height=\"180\" data-init-width=\"300\" data-width=\"502\" decoding=\"async\" height=\"301\" loading=\"lazy\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-5-300x180.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-5-300x180.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-4-5.jpg 328w\" style=\"\" title=\"Image 4\" width=\"502\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click Send.<\/p>\n<p>The server sends the response in the form of json data output. The status code is 200<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779bb121\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2198 tcb-moved-image\" data-css=\"tve-u-181779bbe8f\" data-height=\"221\" data-id=\"2198\" data-init-height=\"115\" data-init-width=\"300\" data-width=\"576\" decoding=\"async\" height=\"221\" loading=\"lazy\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-5-300x115.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-5-300x115.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-5-5.jpg 635w\" style=\"\" title=\"Image 5\" width=\"576\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655567889010\"><b>3.\u00a0<\/b><b><\/b><b><b><b><b>Hit POST request with parameters<\/b><\/b><\/b><\/b><\/h3>\n<p>Let us now add 2 parameters as part of our POST request<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779e0319\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2201\" data-css=\"tve-u-181779e14b0\" data-height=\"241\" data-id=\"2201\" data-init-height=\"137\" data-init-width=\"300\" data-width=\"528\" decoding=\"async\" height=\"241\" loading=\"lazy\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-5-300x137.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-5-300x137.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-6-5.jpg 560w\" style=\"\" title=\"Image 6\" width=\"528\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click Send.<\/p>\n<p>As expected, the 2 parameters are seen as arguments in the response body, see below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779e62bd\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2202\" data-css=\"tve-u-181779e6dee\" data-height=\"339\" data-id=\"2202\" data-init-height=\"193\" data-init-width=\"300\" data-width=\"527\" decoding=\"async\" height=\"339\" loading=\"lazy\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-5-300x193.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-5-300x193.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-7-5.jpg 330w\" style=\"\" title=\"Image 7\" width=\"527\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>The complete response body is as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181779ec7c7\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2203\" data-css=\"tve-u-181779ed647\" data-height=\"395\" data-id=\"2203\" data-init-height=\"243\" data-init-width=\"300\" data-width=\"488\" decoding=\"async\" height=\"395\" loading=\"lazy\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-5-300x243.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-5-300x243.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-8-5.jpg 606w\" style=\"\" title=\"Image 8\" width=\"488\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655567889011\"><b>4.\u00a0<\/b><b><b><b><b><b>Save the POST Request<\/b><\/b><\/b><\/b><\/b><\/h3>\n<p>Let us save this POST request by giving it some name and adding it to the same collection that we had created in our last blog<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a06794\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2204\" data-css=\"tve-u-18177a07713\" data-height=\"268\" data-id=\"2204\" data-init-height=\"162\" data-init-width=\"300\" data-width=\"497\" decoding=\"async\" height=\"268\" loading=\"lazy\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-5-300x162.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-5-300x162.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-9-5.jpg 432w\" style=\"\" title=\"Image 9\" width=\"497\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Our collection now has 3 requests (2 GET requests and a single POST request)<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a0be4f\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2205\" data-css=\"tve-u-18177a0cb33\" data-height=\"265\" data-id=\"2205\" data-init-height=\"147\" data-init-width=\"300\" data-width=\"540\" decoding=\"async\" height=\"265\" loading=\"lazy\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-5-300x147.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-5-300x147.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-10-5.jpg 447w\" style=\"\" title=\"Image 10\" width=\"540\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655567889012\"><b>5.\u00a0<\/b><b><b><b><b><b><b>Generate random unique IDs<\/b><\/b><\/b><\/b><\/b><\/b><\/h3>\n<p>Let us see how to generate random unique IDs using the <b>\/uuid<\/b> method. This method can be seen in the website as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a21c18\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2206\" data-css=\"tve-u-18177a225a5\" data-height=\"221\" data-id=\"2206\" data-init-height=\"123\" data-init-width=\"300\" data-width=\"539\" decoding=\"async\" height=\"221\" loading=\"lazy\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-5-300x123.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-5-300x123.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-11-5.jpg 329w\" style=\"\" title=\"Image 11\" width=\"539\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Copy the URI <a class=\"tve-froala\" href=\"https:\/\/httpbin.org\/uuid\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">https:\/\/httpbin.org<b>\/uuid<\/b><\/a><\/p>\n<p>Paste it as shown below (this is a GET request)<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a28392\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2207\" data-css=\"tve-u-18177a298e6\" data-height=\"73\" data-id=\"2207\" data-init-height=\"48\" data-init-width=\"300\" data-width=\"456\" decoding=\"async\" height=\"73\" loading=\"lazy\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-5-300x48.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-5-300x48.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-12-5.jpg 404w\" style=\"\" title=\"Image 12\" width=\"456\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click Send.<\/p>\n<p>Notice below that a unique id is generated in the response body<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a333d4\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2208\" data-css=\"tve-u-18177a33e32\" data-height=\"162\" data-id=\"2208\" data-init-height=\"93\" data-init-width=\"300\" data-width=\"522\" decoding=\"async\" height=\"162\" loading=\"lazy\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-5-300x93.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-5-300x93.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-13-5.jpg 534w\" style=\"\" title=\"Image 13\" width=\"522\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018Send\u2019 again.<\/p>\n<p>Notice below that another unique id is generated and is different from the above id<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18177a39f2a\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2209\" data-css=\"tve-u-18177a3a804\" data-height=\"126\" data-id=\"2209\" data-init-height=\"70\" data-init-width=\"300\" data-width=\"542\" decoding=\"async\" height=\"126\" loading=\"lazy\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-5-300x70.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-5-300x70.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-14-5.jpg 672w\" style=\"\" title=\"Image 14\" width=\"542\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>This way, we can keep generating different unique random IDs.<\/p>\n<h3 id=\"t-1655567889013\"><b>6.\u00a0<\/b><b><b><b><b><b><b><b>Capture static id and use it in another POST request<\/b><\/b><\/b><\/b><\/b><\/b><\/b><\/h3>\n<p>Sometimes, we have a requirement to capture response of 1st request and send that response as an input to the 2<sup>nd<\/sup> request.\u00a0<\/p>\n<p>Another similar requirement can be: to generate a random id (uuid), capture this id and send it as part of another POST request. The below diagram depicts this scenario<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179da3c42\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2226\" data-css=\"tve-u-18179da49da\" data-height=\"99\" data-id=\"2226\" data-init-height=\"55\" data-init-width=\"300\" data-width=\"538\" decoding=\"async\" height=\"99\" loading=\"lazy\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-5-300x55.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-5-300x55.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-15-5-768x141.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-15-5.jpg 785w\" style=\"\" title=\"Image 15\" width=\"538\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us first see how to capture the <u>static<\/u> id from one request and use it in another request.<\/p>\n<p>Click \u2018Tests\u2019 section<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179dac820\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2227\" data-css=\"tve-u-18179dae05c\" data-height=\"109\" data-id=\"2227\" data-init-height=\"59\" data-init-width=\"300\" data-width=\"555\" decoding=\"async\" height=\"109\" loading=\"lazy\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-4-300x59.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-4-300x59.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-16-4.jpg 717w\" style=\"\" title=\"Image 16\" width=\"555\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Under \u2018Tests\u2019 section, we see a snippet \u2018Set a global variable\u2019. We can use this snippet to work with the variables<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179dcca7d\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2230\" data-css=\"tve-u-18179dcd8b6\" data-height=\"187\" data-id=\"2230\" data-init-height=\"99\" data-init-width=\"300\" data-width=\"566\" decoding=\"async\" height=\"187\" loading=\"lazy\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-17-3-300x99.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-17-3-300x99.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-17-3.jpg 646w\" style=\"\" title=\"Image 17\" width=\"566\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click this function \u2018Set a global variable\u2019. The below code gets generated<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179dd66d6\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2231\" data-css=\"tve-u-18179dd730f\" data-height=\"125\" data-id=\"2231\" data-init-height=\"65\" data-init-width=\"300\" data-width=\"577\" decoding=\"async\" height=\"125\" loading=\"lazy\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-3-300x65.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-3-300x65.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-18-3.jpg 701w\" style=\"\" title=\"Image 18\" width=\"577\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>In the above sample code, we can see 2 <u>global<\/u> variables: \u2018variable_key\u2019 and \u2018variable_value\u2019.<\/p>\n<p>Since these are global variables, we can call and use them in other requests as well.<\/p>\n<p>Let us suppose the value of the variable \u2018variable_key\u2019 is uuid<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179ddfaf5\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2232\" data-css=\"tve-u-18179de07a8\" data-height=\"92\" data-id=\"2232\" data-init-height=\"48\" data-init-width=\"300\" data-width=\"572\" decoding=\"async\" height=\"92\" loading=\"lazy\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-3-300x48.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-3-300x48.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-19-3.jpg 605w\" style=\"\" title=\"Image 19\" width=\"572\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us hard code the value of the variable \u2018variable_value\u2019 as t123, see below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179dec745\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2233\" data-css=\"tve-u-18179ded26d\" data-height=\"87\" data-id=\"2233\" data-init-height=\"49\" data-init-width=\"300\" data-width=\"534\" decoding=\"async\" height=\"87\" loading=\"lazy\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-20-2-300x49.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-20-2-300x49.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-20-2.jpg 417w\" style=\"\" title=\"Image 20\" width=\"534\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018Send\u2019 to execute the GET request<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179df6259\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2234\" data-css=\"tve-u-18179df6d14\" data-height=\"314\" data-id=\"2234\" data-init-height=\"180\" data-init-width=\"300\" data-width=\"523\" decoding=\"async\" height=\"314\" loading=\"lazy\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-21-2-300x180.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-21-2-300x180.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-21-2.jpg 606w\" style=\"\" title=\"Image 21\" width=\"523\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Now we would like to send the above global \u2018uuid\u2019 variable in another POST request.<\/p>\n<p>We have one POST request saved in our collection<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e02398\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2235\" data-css=\"tve-u-18179e0319c\" data-height=\"332\" data-id=\"2235\" data-init-height=\"190\" data-init-width=\"300\" data-width=\"524\" decoding=\"async\" height=\"332\" loading=\"lazy\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-22-2-300x190.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-22-2-300x190.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-22-2.jpg 324w\" style=\"\" title=\"Image 22\" width=\"524\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Open this POST request. Make sure \u2018Body\u2019 and \u2018raw\u2019 section are selected as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e0a3f4\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2236\" data-css=\"tve-u-18179e0ad47\" data-height=\"294\" data-id=\"2236\" data-init-height=\"159\" data-init-width=\"300\" data-width=\"554\" decoding=\"async\" height=\"294\" loading=\"lazy\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-23-2-300x159.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-23-2-300x159.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-23-2.jpg 553w\" style=\"\" title=\"Image 23\" width=\"554\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>To capture the value of global \u2018uuid\u2019 variable (from our GET request), we need to mention the \u2018uuid\u2019 variable in double curly braces {{}} as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e1178a\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2237\" data-css=\"tve-u-18179e12e68\" data-height=\"431\" data-id=\"2237\" data-init-height=\"270\" data-init-width=\"300\" data-width=\"479\" decoding=\"async\" height=\"431\" loading=\"lazy\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-24-2-300x270.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-24-2-300x270.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-24-2.jpg 352w\" style=\"\" title=\"Image 24\" width=\"479\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So basically, we have created a variable \u2018id\u2019 as shown above and the value of this \u2018id\u2019 variable would be the value of \u2018uuid\u2019 variable that would be fetched from the GET request.<\/p>\n<p>Click \u2018Send\u2019 to execute this POST request.<\/p>\n<p>Notice the json response below. The value of \u2018uuid\u2019 variable (t123) gets fetched from the GET request \u00a0<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e1d086\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2238\" data-css=\"tve-u-18179e1e5a3\" data-height=\"704\" data-id=\"2238\" data-init-height=\"300\" data-init-width=\"223\" data-width=\"523\" decoding=\"async\" height=\"704\" loading=\"lazy\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-25-2-223x300.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-25-2-223x300.jpg 223w, \/blog\/wp-content\/uploads\/2022\/06\/Image-25-2.jpg 344w\" style=\"\" title=\"Image 25\" width=\"523\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655567889014\"><b>7.\u00a0<\/b><b><b><b><b><b><b><b><b>Generate random id and use it in another POST request<\/b><\/b><\/b><\/b><\/b><\/b><\/b><\/b><\/h3>\n<p>In the above scenario, we captured the hard coded value of uuid from GET request and used it in another POST request.<\/p>\n<p>Our actual requirement is to capture the random (dynamic) uuid from one request and use it in another request.<\/p>\n<p>Recall that, below is the sample random uuid as part of json response<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e3e983\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2239\" data-css=\"tve-u-18179e3f3d9\" data-height=\"337\" data-id=\"2239\" data-init-height=\"192\" data-init-width=\"300\" data-width=\"527\" decoding=\"async\" height=\"337\" loading=\"lazy\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-26-2-300x192.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-26-2-300x192.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-26-2.jpg 606w\" style=\"\" title=\"Image 26\" width=\"527\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>To capture this json response, we can use the below code snippet. We are defining a variable jsn_response and inside this variable we are capturing the json response at runtime. Notice that we have pm.response.<b>json()<\/b> method available<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e478af\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2240\" data-css=\"tve-u-18179e480cd\" data-height=\"220\" data-id=\"2240\" data-init-height=\"120\" data-init-width=\"300\" data-width=\"549\" decoding=\"async\" height=\"220\" loading=\"lazy\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-27-2-300x120.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-27-2-300x120.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-27-2.jpg 537w\" style=\"\" title=\"Image 27\" width=\"549\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So we can write<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e4dec1\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2241\" data-css=\"tve-u-18179e4f304\" data-height=\"190\" data-id=\"2241\" data-init-height=\"112\" data-init-width=\"300\" data-width=\"509\" decoding=\"async\" height=\"190\" loading=\"lazy\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-28-2-300x112.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-28-2-300x112.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-28-2.jpg 522w\" style=\"\" title=\"Image 28\" width=\"509\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So the variable <b>jsn_response <\/b>holds the entire json response, including the value of uuid that gets generated during runtime, example, ec7e14f4-ef6e-47c9-9ec0-63b6524d7a94.<\/p>\n<p>Next, we will remove the hard coded value \u2018t123\u2019. Instead of that, we will write <b>jsn_response.uuid<\/b><\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e554c6\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2242\" data-css=\"tve-u-18179e563d1\" data-height=\"228\" data-id=\"2242\" data-init-height=\"123\" data-init-width=\"300\" data-width=\"556\" decoding=\"async\" height=\"228\" loading=\"lazy\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-29-2-300x123.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-29-2-300x123.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-29-2.jpg 602w\" style=\"\" title=\"Image 29\" width=\"556\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><b>\u00a0<\/b>So we have<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e5c798\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2243\" data-css=\"tve-u-18179e5d37c\" data-height=\"195\" data-id=\"2243\" data-init-height=\"115\" data-init-width=\"300\" data-width=\"509\" decoding=\"async\" height=\"195\" loading=\"lazy\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-30-2-300x115.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-30-2-300x115.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-30-2.jpg 549w\" style=\"\" title=\"Image 30\" width=\"509\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us now hit the \u2018Send\u2019 button of this GET request. The random uuid gets generated<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e645fa\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2246\" data-css=\"tve-u-18179e657ab\" data-height=\"335\" data-id=\"2246\" data-init-height=\"188\" data-init-width=\"300\" data-width=\"535\" decoding=\"async\" height=\"335\" loading=\"lazy\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-31-2-300x188.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-31-2-300x188.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-31-2.jpg 630w\" style=\"\" title=\"Image 31\" width=\"535\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us now go to the POST request and hit the \u2018Send\u2019 button. Notice below that the value of \u2018id\u2019 is same as the value of uuid that was generated in the above screenshot<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e6bad3\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2247\" data-css=\"tve-u-18179e6c5db\" data-height=\"348\" data-id=\"2247\" data-init-height=\"197\" data-init-width=\"300\" data-width=\"530\" decoding=\"async\" height=\"348\" loading=\"lazy\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-32-1-300x197.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-32-1-300x197.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-32-1.jpg 629w\" style=\"\" title=\"Image 32\" width=\"530\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Go to the GET request and let us hit the \u2018Send\u2019 button one more time. Note down the value of uuid, see below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e7336d\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2248\" data-css=\"tve-u-18179e741a9\" data-height=\"334\" data-id=\"2248\" data-init-height=\"199\" data-init-width=\"300\" data-width=\"503\" decoding=\"async\" height=\"334\" loading=\"lazy\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-33-1-300x199.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-33-1-300x199.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-33-1.jpg 649w\" style=\"\" title=\"Image 33\" width=\"503\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Go to the POST request and hit the \u2018Send\u2019 button.<\/p>\n<p>Notice that the value of \u2018id\u2019 is same as the value of \u2018uuid\u2019 generated above<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e7a7fb\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2249\" data-css=\"tve-u-18179e7b52b\" data-height=\"307\" data-id=\"2249\" data-init-height=\"178\" data-init-width=\"300\" data-width=\"517\" decoding=\"async\" height=\"307\" loading=\"lazy\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-34-1-300x178.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-34-1-300x178.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-34-1.jpg 656w\" style=\"\" title=\"Image 34\" width=\"517\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Save the requests<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e80fee\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2250\" data-css=\"tve-u-18179e81b3c\" data-height=\"276\" data-id=\"2250\" data-init-height=\"158\" data-init-width=\"300\" data-width=\"524\" decoding=\"async\" height=\"276\" loading=\"lazy\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-35-1-300x158.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-35-1-300x158.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-35-1.jpg 479w\" style=\"\" title=\"Image 35\" width=\"524\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us drag \u2018GET_uuid\u2019 request above \u2018POSTwithParams\u2019, see below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18179e87b5a\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2251\" data-css=\"tve-u-18179e8854b\" data-height=\"322\" data-id=\"2251\" data-init-height=\"177\" data-init-width=\"300\" data-width=\"545\" decoding=\"async\" height=\"322\" loading=\"lazy\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-36-1-300x177.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-36-1-300x177.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-36-1.jpg 485w\" style=\"\" title=\"Image 36\" width=\"545\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So this is how we can chain the GET and POST requests.<\/p>\n<p>In the next article, we will perform some Test validations in the POST request. We will also see how to handle cookies.<\/p>\n<p>Thank you for reading!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb_flag\" style=\"display: none\"><\/div>\n<\/section>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents Hitting POST Requests and chain 2 requests using Postman 1. What you will Learn in this blog? 2. \u00a0Hit POST request without parameters 3.\u00a0Hit POST request with parameters 4.\u00a0Save the POST Request 5.\u00a0Generate random unique IDs 6.\u00a0Capture static id and use it in another POST request 7.\u00a0Generate random id and use it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1929","post","type-post","status-publish","format-standard","hentry","category-api","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1929"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1929\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}