{"id":1920,"date":"2022-06-17T05:58:20","date_gmt":"2022-06-17T05:58:20","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/elements-of-rest-architecture\/"},"modified":"2022-06-17T05:58:20","modified_gmt":"2022-06-17T05:58:20","slug":"elements-of-rest-architecture","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/elements-of-rest-architecture\/","title":{"rendered":"Elements of REST Architecture"},"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=\"1920\" 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-62ac17fc06eee6\",\"1\":\"tve-u-62ac17fc06ef09\",\"2\":\"tve-u-62ac17fc06ef19\"}' data-columns=\"1\" data-columns-d=\"1\" data-css=\"tve-u-62ac17fc06eed8\" 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-62ac17fc06eda8\",\"1\":\"tve-u-62ac17fc06ee92\",\"2\":\"tve-u-62ac17fc06eeb6\"}' data-highlight=\"section\" data-number-style='{\"0\":\"tve-u-62ac17fc06ef37\",\"1\":\"tve-u-62ac17fc06ef43\",\"2\":\"tve-u-62ac17fc06ef63\"}' 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-62ac17fc06ef81\" 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-62ac17fc06ef92\" 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-62ac17fc06efb6\" 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-62ac17fc06efc9\" 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-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525892\" jump-animation=\"smooth\">Elements of REST Architecture\u00a0<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1608133326002\" 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-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525893\" jump-animation=\"smooth\">2. Difference between URL and URI<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525894\" jump-animation=\"smooth\">3. Resource<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525895\" jump-animation=\"smooth\">4. Base URI<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525896\" jump-animation=\"smooth\">5. Representation<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525897\" jump-animation=\"smooth\">6. Representation Metadata<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525898\" jump-animation=\"smooth\">7. Difference between path parameter and query parameter<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac17fc06ee92\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655532525899\" jump-animation=\"smooth\">8. URI composition<\/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-62ac17fc06ef81\" 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-1655532525892\"><b>Elements of REST Architecture<\/b>\u00a0<\/h3>\n<p>Welcome you all to the brand new \u2018API Testing\u2019 blog series! In the previous blog, we had learned about the HTTP elements and methods. In this tutorial, we will learn about the basic REST API elements!!\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 class=\"\" id=\"t-1608133326002\"><b>1. What you will Learn in this blog ?<\/b><\/h3>\n<ul class=\"\">\n<li>Difference between URL and URI<\/li>\n<li>Resource<\/li>\n<li>Base URI<\/li>\n<li>Representation<\/li>\n<li>Representation Metadata<\/li>\n<li>Difference between path parameter and query parameter<\/li>\n<li>URI composition<\/li>\n<\/ul>\n<h3 class=\"\" id=\"t-1655532525893\"><b>2. <b>Difference between URL and URI<\/b><\/b><\/h3>\n<p>To understand the difference between URL and URI, let us launch the homepage <a href=\"https:\/\/rahulshettyacademy.com\">https:\/\/rahulshettyacademy.com<\/a><\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181757de51e\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2064\" data-css=\"tve-u-181757df0d1\" data-height=\"312\" data-id=\"2064\" data-init-height=\"184\" data-init-width=\"300\" data-width=\"509\" decoding=\"async\" height=\"312\" loading=\"lazy\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-2-300x184.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-2-300x184.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-1-2-768x471.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-1-2.jpg 825w\" style=\"\" title=\"Image 1\" width=\"509\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So, to locate the \u2018rahulshettyacademy\u2019 webpage resource on the internet, we used the above URL.<\/p>\n<p>Similarly, to locate any other resource (image, link etc) on the internet, we will make use of the URL. For example, below is the link (resource) to the \u2018courses\u2019 page \u00a0<\/p>\n<p><a href=\"https:\/\/courses.rahulshettyacademy.com\/courses\">https:\/\/courses.rahulshettyacademy.com\/courses<\/a><\/p>\n<p>So, this is the html page path or html page address, also called as URL<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181757e7153\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2065\" data-css=\"tve-u-181757e7e9c\" data-height=\"273\" data-id=\"2065\" data-init-height=\"155\" data-init-width=\"300\" data-width=\"529\" decoding=\"async\" height=\"273\" loading=\"lazy\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-2-300x155.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-2-300x155.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-2-2.jpg 741w\" style=\"\" title=\"Image 2\" width=\"529\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Similarly, for the image (open the image in new tab)<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817580bc7f\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2066\" data-css=\"tve-u-1817580e156\" data-height=\"151\" data-id=\"2066\" data-init-height=\"85\" data-init-width=\"300\" data-width=\"533\" decoding=\"async\" height=\"151\" loading=\"lazy\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-2-300x85.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-2-300x85.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-3-2.jpg 720w\" style=\"\" title=\"Image 3\" width=\"533\"\/><\/span><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817581623b\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2069\" data-css=\"tve-u-181758172ef\" data-height=\"307\" data-id=\"2069\" data-init-height=\"176\" data-init-width=\"300\" data-width=\"524\" decoding=\"async\" height=\"307\" loading=\"lazy\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-2-300x176.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-2-300x176.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-4-2-768x451.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-4-2.jpg 825w\" style=\"\" title=\"Image 4\" width=\"524\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>As you can see above, the URL of this image (address of the image) is<\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/assets\/images\/qa_slide_new.png\" style=\"outline: none;\">https:\/\/rahulshettyacademy.com\/assets\/images\/qa_slide_new.png<\/a><\/p>\n<p>Let us now understand what URI is. It is \u2018Uniform Resource Identifier\u2019. So basically, to identify any REST based webservice on internet, we use URI.<\/p>\n<p>Let us launch a sample flights webservice URI<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817581ca14\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2070 tcb-moved-image\" data-css=\"tve-u-1817581d559\" data-height=\"127\" data-id=\"2070\" data-init-height=\"67\" data-init-width=\"300\" data-width=\"567\" decoding=\"async\" height=\"127\" loading=\"lazy\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-2-300x67.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-2-300x67.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-5-2-768x171.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-5-2.jpg 834w\" style=\"\" title=\"Image 5\" width=\"567\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><a class=\"tve-froala fr-basic\" href=\"http:\/\/ilt.mulesoft-training.com\/essentials\/united\/flights\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">http:\/\/ilt.mulesoft-training.com\/essentials\/united\/flights<\/a><\/p>\n<p>So, this is a REST webservice URI that is used to identify flights over the internet. The above URI is without any parameter.<\/p>\n<p>We can add a URI parameter (example CLE as shown below)<\/p>\n<p><a class=\"tve-froala\" href=\"http:\/\/ilt.mulesoft-training.com\/essentials\/united\/flights\/CLE\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">http:\/\/ilt.mulesoft-training.com\/essentials\/united\/flights\/<b>CLE<\/b><\/a><\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18175828215\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2071\" data-css=\"tve-u-18175829061\" data-height=\"74\" data-id=\"2071\" data-init-height=\"42\" data-init-width=\"300\" data-width=\"532\" decoding=\"async\" height=\"74\" loading=\"lazy\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-2-300x42.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-2-300x42.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-6-2-768x107.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-6-2.jpg 805w\" style=\"\" title=\"Image 6\" width=\"532\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So, in essence, URL is an address for a particular web resource like webpage or image. URI is used to identify REST webservice running on a server (with\/without parameter) or we can also say that REST webservice uses URI to identify resources<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18175835bf7\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2072\" data-css=\"tve-u-181758372b6\" data-height=\"156\" data-id=\"2072\" data-init-height=\"88\" data-init-width=\"300\" data-width=\"531\" decoding=\"async\" height=\"156\" loading=\"lazy\" sizes=\"auto, (max-width: 531px) 100vw, 531px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-2-300x88.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-2-300x88.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-7-2-768x224.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-7-2.jpg 792w\" style=\"\" title=\"Image 7\" width=\"531\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655532525894\"><b>3. <b>Resource<\/b><\/b><\/h3>\n<p>Resource is simply the information or data stored on a server that is requested by the client.<\/p>\n<p>Whenever, we are trying to access something on a particular webservice\/website, we are defining a specific URI to access that \u2018thing\u2019. That \u2018thing\u2019 is called the \u2018Resource\u2019 in terms of the REST Assured.<\/p>\n<p>Below diagram is self-explanatory. When we make a REST request to server, the information that we receive back from the server is called a \u2018Resource\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181758760cb\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2073\" data-css=\"tve-u-18175877298\" data-height=\"164\" data-id=\"2073\" data-init-height=\"89\" data-init-width=\"300\" data-width=\"553\" decoding=\"async\" height=\"164\" loading=\"lazy\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-2-300x89.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-2-300x89.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-8-2-768x228.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-8-2.jpg 837w\" style=\"\" title=\"Image 8\" width=\"553\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So when we launch the site, there are 2 parts to it: domain name plus the Resource that we are trying to access <a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/practice-project\" style=\"outline: none;\">https:\/\/rahulshettyacademy.com\/<b>practice-project<\/b><\/a><\/p>\n<p>When we hit the above page pointing to \u2018practice-project\u2019 resource on the server, we get back the information of the \u2018practice-project\u2019 page.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817587ecb0\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2074 tcb-moved-image\" data-css=\"tve-u-1817587f6a0\" data-height=\"257\" data-id=\"2074\" data-init-height=\"145\" data-init-width=\"300\" data-width=\"532\" decoding=\"async\" height=\"257\" loading=\"lazy\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-2-300x145.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-2-300x145.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-9-2-768x371.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-9-2.jpg 785w\" style=\"\" title=\"Image 9\" width=\"532\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Similarly \u2018lifetime-access\u2019 is another resource inside the same domain, see below<\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/lifetime-access\" style=\"outline: none;\">https:\/\/rahulshettyacademy.com\/<b>lifetime-access<\/b><\/a><!--[if !supportLineBreakNewLine]--><!--[endif]--><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817588f562\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2075\" data-css=\"tve-u-1817589051e\" data-height=\"424\" data-id=\"2075\" data-init-height=\"241\" data-init-width=\"300\" data-width=\"528\" decoding=\"async\" height=\"424\" loading=\"lazy\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-2-300x241.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-2-300x241.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-10-2.jpg 639w\" style=\"\" title=\"Image 10\" width=\"528\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655532525895\"><b>4. <b><b>Base URI<\/b><\/b><\/b><\/h3>\n<p>The host domain of any website never changes. It is called as \u2018Base URI\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181758a3e44\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2076\" data-css=\"tve-u-181758a4ca3\" data-height=\"214\" data-id=\"2076\" data-init-height=\"112\" data-init-width=\"300\" data-width=\"574\" decoding=\"async\" height=\"214\" loading=\"lazy\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-2-300x112.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-2-300x112.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-11-2-768x287.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-11-2.jpg 855w\" style=\"\" title=\"Image 11\" width=\"574\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Notice below that all of them have same base URI but different resource<\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/practice-project\" style=\"outline: none;\"><b>https:\/\/rahulshettyacademy.com<\/b>\/practice-project<\/a><\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/lifetime-access\" style=\"outline: none;\"><b>https:\/\/rahulshettyacademy.com<\/b>\/lifetime-access<\/a><\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/blog\/\" style=\"outline: none;\"><b>https:\/\/rahulshettyacademy.com<\/b>\/blog\/<\/a><\/p>\n<p>Similarly see below 2 examples<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181758ac362\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2077\" data-css=\"tve-u-181758ad10e\" data-height=\"155\" data-id=\"2077\" data-init-height=\"88\" data-init-width=\"300\" data-width=\"529\" decoding=\"async\" height=\"155\" loading=\"lazy\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-2-300x88.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-2-300x88.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-12-2-768x226.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-12-2.jpg 973w\" style=\"\" title=\"Image 12\" width=\"529\"\/><\/span><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181758f4796\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2079\" data-css=\"tve-u-181758f5ac5\" data-height=\"113\" data-id=\"2079\" data-init-height=\"64\" data-init-width=\"300\" data-width=\"529\" decoding=\"async\" height=\"113\" loading=\"lazy\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-2-300x64.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-2-300x64.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-13-2.jpg 689w\" style=\"\" title=\"Image 13\" width=\"529\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655532525896\"><b>5. <b>Representation<\/b><\/b><\/h3>\n<p>Now, we know that, the \u2018Resource\u2019 is actual data or information. Over the internet, this resource can be represented as XML, JSON, HTML, CSS etc.<\/p>\n<p>\u00a0Recall that, whenever we send a request from the browser, the request goes to the server and the server sends back the resource\/data\/information back to the client browser. The browser represents this data to the client in the form of webpage comprising of HTML, CSS etc.<\/p><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-181758ed0ca\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2078\" data-css=\"tve-u-181758ee3db\" data-height=\"176\" data-id=\"2078\" data-init-height=\"101\" data-init-width=\"300\" data-width=\"524\" decoding=\"async\" height=\"176\" loading=\"lazy\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-2-300x101.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-2-300x101.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-14-2.jpg 710w\" style=\"\" title=\"Image 14\" width=\"524\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655532525897\"><b>6. <b>Representation Metadata<\/b><\/b><\/h3>\n<p>The extra data which is coming with the resource. So, along with the Representation data, we will always get the metadata from the server. For example, the Date when the resource was fetched, type of protocol, cache etc.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817590618b\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2080\" data-css=\"tve-u-18175906ef2\" data-height=\"131\" data-id=\"2080\" data-init-height=\"71\" data-init-width=\"300\" data-width=\"554\" decoding=\"async\" height=\"131\" loading=\"lazy\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-2-300x71.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-2-300x71.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-15-2-768x182.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-15-2.jpg 895w\" style=\"\" title=\"Image 15\" width=\"554\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Look at the below \u2018Response\u2019 header metadata. Some of the metadata information that we can see is: Date, Server info, cookie etc<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817590cc64\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2081\" data-css=\"tve-u-1817590d6ae\" data-height=\"443\" data-id=\"2081\" data-init-height=\"239\" data-init-width=\"300\" data-width=\"556\" decoding=\"async\" height=\"443\" loading=\"lazy\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-1-300x239.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-1-300x239.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-16-1.jpg 650w\" style=\"\" title=\"Image 16\" width=\"556\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655532525898\"><b>7. <b><b>Difference between path parameter and query parameter<\/b><\/b><\/b><\/h3>\n<p>To understand the difference, consider below 4 cases (some of these are dummy urls). In the first case, we are launching base url<\/p>\n<p><a href=\"http:\/\/www.twitter.com\/india\" rel=\"noopener\" target=\"_blank\">twitter.com<\/a> (base URL)<\/p>\n<p>In the second case, we are appending a resource \u2018india\u2019 to base URL <br \/><a href=\"http:\/\/www.twitter.com\/india\" rel=\"noopener\" target=\"_blank\">twitter.com\/<b>india<\/b><\/a><\/p>\n<p>In the third case, we are appending path parameter \u2018profile\u2019, we can use this path parameter to fetch all the profiles from entire \u2018india\u2019 location<\/p>\n<p><a class=\"tve-froala\" href=\"http:\/\/www.twitter.com\/india\/profile\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">twitter.com\/india\/<b>profile<\/b><\/a><\/p>\n<p>In the fourth case, we are appending query parameter \u2018profile?=delhi\u2019, we can use this filter parameter to fetch the profiles only from \u2018delhi\u2019 location<\/p>\n<p><a class=\"tve-froala\" href=\"http:\/\/www.twitter.com\/india\/profile?=delhi\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">twitter.com\/india\/profile<b>?=delhi<\/b><\/a><br class=\"\"\/><b class=\"\"><\/b><br class=\"\"\/><\/p>\n<h3 class=\"\" id=\"t-1655532525899\"><b>8. <b><b><b>URI composition<\/b><\/b><\/b><\/b><\/h3>\n<p>Let us search for any keyword in google\u00a0<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817592b6bb\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2082\" data-css=\"tve-u-1817592c90d\" data-height=\"183\" data-id=\"2082\" data-init-height=\"104\" data-init-width=\"300\" data-width=\"527\" decoding=\"async\" height=\"183\" loading=\"lazy\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-17-1-300x104.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-17-1-300x104.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-17-1-768x266.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-17-1.jpg 947w\" style=\"\" title=\"Image 17\" width=\"527\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>The syntax of complete URI can be constructed as below:<\/p>\n<p>URI = protocol:\/\/Domain\/Resource[? query parameter in the form of key=value pair]&amp;[another query parameter]\u2026<\/p>\n<p>Note that the server can have multiple resources under the same path (just like we can have multiple files inside the same directory). Since each resource has some physical location on the server, we use query parameter to inform server which resource we want to get.<\/p>\n<p>For example, we can construct a URI to query the users on page 1<\/p>\n<p><a class=\"tve-froala\" href=\"https:\/\/reqres.in\/api\/users?page=1\" rel=\"noopener\" style=\"outline: none;\" target=\"_blank\">https:\/\/reqres.in\/api\/users?page=1<\/a><\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817593334b\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2083\" data-css=\"tve-u-1817593451d\" data-height=\"302\" data-id=\"2083\" data-init-height=\"164\" data-init-width=\"300\" data-width=\"553\" decoding=\"async\" height=\"302\" loading=\"lazy\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-1-300x164.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-1-300x164.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-18-1.jpg 487w\" style=\"\" title=\"Image 18\" width=\"553\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Similarly we can query the users on page 5, see below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-18175938e5e\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2084\" data-css=\"tve-u-18175939ece\" data-height=\"102\" data-id=\"2084\" data-init-height=\"58\" data-init-width=\"300\" data-width=\"529\" decoding=\"async\" height=\"102\" loading=\"lazy\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-1-300x58.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-1-300x58.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-19-1.jpg 528w\" style=\"\" title=\"Image 19\" width=\"529\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So, this was all about the various elements used in REST API terminology. We will next start with Postman (test REST APIs manually).<\/p>\n<p>Thank you for reading!<\/p>\n<p><b class=\"\"><\/b><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><\/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 Elements of REST Architecture\u00a0 1. What you will Learn in this blog ? 2. Difference between URL and URI 3. Resource 4. Base URI 5. Representation 6. Representation Metadata 7. Difference between path parameter and query parameter 8. URI composition Elements of REST Architecture\u00a0 Welcome you all to the brand new \u2018API [&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-1920","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\/1920","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=1920"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1920\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}