{"id":156,"date":"2024-06-10T05:11:13","date_gmt":"2024-06-10T05:11:13","guid":{"rendered":"https:\/\/istqblearning.com\/testing\/?page_id=156"},"modified":"2024-06-28T10:25:36","modified_gmt":"2024-06-28T10:25:36","slug":"rest-api","status":"publish","type":"page","link":"https:\/\/istqblearning.com\/testing\/rest-api\/","title":{"rendered":"Introducing REST API"},"content":{"rendered":"\n<!DOCTYPE html>\n<html>\n<head>\n<style>\n\na:hover {\n  background-color: #ddd;\n  color: black;\n}\n\n.previousnext {\n  text-decoration: none;\n  display: inline-block;\n  padding: 8px 16px;\n  background-color: #f1f1f1;\n  color: black;\n}\n\n<\/style>\n<\/head>\n<body>\n\n<a href=\"https:\/\/istqblearning.com\/testing\/install-and-configure-postman\/\" class=\"previousnext\">Next &raquo;<\/a>\n  \n<\/body>\n<\/html>\n\n\n\n<p><strong><strong>R<\/strong><\/strong>epresentational&nbsp;<strong><strong>S<\/strong><\/strong>tate&nbsp;<strong><strong>T<\/strong><\/strong>ransfer (REST) is an architectural style that defines a set of constraints to be used for creating web services.&nbsp;REST API&nbsp;is a way of accessing web services in a simple and flexible way without having any processing.<\/p>\n\n\n\n<p>In&nbsp;<strong>HTTP&nbsp;<\/strong>there are four methods that are commonly used in a REST-based Architecture i.e., POST, GET, PUT, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations respectively.<\/p>\n\n\n\n<p><strong>GET:&nbsp;<\/strong>This method allows for the server to find the data you requested and sends it back to you.<\/p>\n\n\n\n<p><strong>PUT:<\/strong>&nbsp;If you perform the \u2018PUT\u2019 request, then the server will update an entry in the database.<\/p>\n\n\n\n<p><strong>POST:<\/strong>&nbsp;This method permits the server to create a new entry in the database.<\/p>\n\n\n\n<p><strong>DELETE:&nbsp;<\/strong>This method allows the server to delete an entry in the database.<\/p>\n\n\n\n<p>In this tutorial, we will practice these methods (CRUD) and use the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Postman: Postman is a standalone software testing API (Application Programming Interface) platform to build, test, design, modify, and document APIs. We will use this tool to make HTTP GET, POST, PUT, DELETE requests.<\/li>\n\n\n\n<li>Curl: Curl is a command-line tool for transferring data from a client or to a server, designed to work without user interaction. With Curl, you can upload or download data using one of the supported protocols, including HTTP, HTTPS, SCP, SFTP, and FTP. Like using Postman, e will use this tool to make HTTP GET, POST, PUT, DELETE requests. Windows 10 already contains Curl, but for Windows 7 and 8, you still need to download and install Curl from the official website.<\/li>\n\n\n\n<li>CRUD a post via REST API from the web site <a href=\"https:\/\/istqblearning.com\/\">https:\/\/istqblearning.com\/<\/a>.<\/li>\n\n\n\n<li>Using API Basic Authentication. There are many other types such as JWT Authentication, API Key Authentication, OAUTH 2.0 Authentication&#8230; Basic authentication is a simple authentication protocol used to authenticate users when accessing a web application or a web server. It involves sending a username and password to the server in plaintext, encoded using Base64 encoding, as part of an HTTP request.<\/li>\n<\/ul>\n\n\n\n<!DOCTYPE html>\n<html>\n<head>\n<style>\n\na:hover {\n  background-color: #ddd;\n  color: black;\n}\n\n.previousnext {\n  text-decoration: none;\n  display: inline-block;\n  padding: 8px 16px;\n  background-color: #f1f1f1;\n  color: black;\n}\n\n<\/style>\n<\/head>\n<body>\n\n<a href=\"https:\/\/istqblearning.com\/testing\/install-and-configure-postman\/\" class=\"previousnext\">Next &raquo;<\/a>\n  \n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Next &raquo; Representational&nbsp;State&nbsp;Transfer (REST) is an architectural style that defines a set of constraints to be used for creating web services.&nbsp;REST API&nbsp;is a way of accessing web services in a simple and flexible way without having any processing. In&nbsp;HTTP&nbsp;there are four methods that are commonly used in a REST-based Architecture i.e., POST, GET, PUT, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-156","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/pages\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":15,"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/pages\/156\/revisions"}],"predecessor-version":[{"id":711,"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/pages\/156\/revisions\/711"}],"wp:attachment":[{"href":"https:\/\/istqblearning.com\/testing\/wp-json\/wp\/v2\/media?parent=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}