<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: KrishnenduDG</title>
    <description>The latest articles on Forem by KrishnenduDG (@krishnendudg).</description>
    <link>https://forem.com/krishnendudg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F709534%2F608c13ab-d609-4145-8470-740150c6ea1e.png</url>
      <title>Forem: KrishnenduDG</title>
      <link>https://forem.com/krishnendudg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/krishnendudg"/>
    <language>en</language>
    <item>
      <title>Cloud Computing - What, Why and When?</title>
      <dc:creator>KrishnenduDG</dc:creator>
      <pubDate>Mon, 24 Apr 2023 12:06:19 +0000</pubDate>
      <link>https://forem.com/krishnendudg/cloud-computing-what-why-and-when-c6l</link>
      <guid>https://forem.com/krishnendudg/cloud-computing-what-why-and-when-c6l</guid>
      <description>&lt;p&gt;Well, these days "&lt;strong&gt;Cloud Computing&lt;/strong&gt;" isn't a very new term and every developer comes across it once in a while.But the ways people perceive the concept about it is numerous especially due to the fact that every person has a different use case in their mind while learning or exploring something.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;b&gt;N.B.&lt;/b&gt;&lt;/u&gt;: You need to have some basic ideas and use cases of working with a &lt;em&gt;static website&lt;/em&gt; and a &lt;em&gt;dynamic website&lt;/em&gt;. Otherwise, learning Cloud Computing is just like another Theoretical Subject with no practical and real-life implications in your mind!&lt;/p&gt;

&lt;p&gt;The Term "&lt;strong&gt;Cloud Computing&lt;/strong&gt;" was coined by &lt;strong&gt;US National Institute of Standards and Technology&lt;/strong&gt;. According to them,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Cloud Computing&lt;/strong&gt; is a &lt;strong&gt;model&lt;/strong&gt; for enabling ubiquitous, convenient, on-demand network access to a &lt;em&gt;shared pool of configurable computing resources&lt;/em&gt; (e.g., &lt;strong&gt;networks&lt;/strong&gt; , &lt;strong&gt;servers&lt;/strong&gt; , &lt;strong&gt;storage&lt;/strong&gt; , &lt;strong&gt;applications&lt;/strong&gt; , and &lt;strong&gt;services&lt;/strong&gt;) that can be rapidly provisioned and released with &lt;em&gt;minimal management effort&lt;/em&gt; or service provider interaction. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple terms, Cloud Computing is that concept or a facility through which users can get access to a &lt;strong&gt;shared pool of Computing resources and services&lt;/strong&gt; through a Cloud Provider..&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Cloud Computing?
&lt;/h2&gt;

&lt;p&gt;Now the basic question which arises while exploring a new domain is that "Why should anyone use it?🤔🤔" and Cloud Computing is not an exception. &lt;/p&gt;

&lt;p&gt;Some of the basic benefits that it provides are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Less Need of Management&lt;/u&gt;:&lt;/h4&gt; While developing a &lt;strong&gt;&lt;em&gt;production level application&lt;/em&gt;&lt;/strong&gt; , the team of developers need to focus on a lot of areas like &lt;em&gt;Architecture&lt;/em&gt; , &lt;em&gt;Design and Prototyping&lt;/em&gt; , &lt;em&gt;Coding&lt;/em&gt; , &lt;em&gt;Testing&lt;/em&gt; etc. But all of this is of no use if the product couldn't be shipped to the &lt;strong&gt;Deployment Phase&lt;/strong&gt; . Again, for deployment, we at least need a &lt;strong&gt;basic server&lt;/strong&gt; to provide the end users with our product and a &lt;strong&gt;Database&lt;/strong&gt; for obvious reasons. Now, hosting and managing the product at the same time can be very difficult for a team. And there comes the need of Cloud Computing. 
The Cloud Provider offers us with a lot of &lt;strong&gt;computing resources&lt;/strong&gt;(like &lt;em&gt;VMs&lt;/em&gt; , &lt;em&gt;Databases&lt;/em&gt; , &lt;em&gt;Cloud Functions&lt;/em&gt; etc.) to deploy our application with an added benefit of almost 0% concern for managing and maintaining those, so that the developers can very well focus on the &lt;strong&gt;business logic&lt;/strong&gt; of their product.&lt;/li&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Highly Customisable&lt;/u&gt;:&lt;/h4&gt; While allocating the Resources for our application, we are provided with a &lt;em&gt;large variety of customising facility&lt;/em&gt; through the dashboard, so that we can choose the most appropriate and efficient Infrastructure that best suits our needs.
A basic example would be allocating a &lt;strong&gt;VM&lt;/strong&gt;(&lt;strong&gt;&lt;em&gt;Virtual Machine&lt;/em&gt;&lt;/strong&gt;). While doing so, we are provided with the options like &lt;strong&gt;Allocating Region of The VM&lt;/strong&gt;, &lt;strong&gt;OS to install in the VM&lt;/strong&gt; ,&lt;strong&gt;GPU Configurations&lt;/strong&gt; , &lt;strong&gt;Network Configurations Like Firewall&lt;/strong&gt; etc.&lt;/li&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Cost efficient&lt;/u&gt;:&lt;/h4&gt; The Cloud Provider provides us with a very convenient and lucrative scheme of &lt;strong&gt;&lt;em&gt;"pay-as-you-go"&lt;/em&gt;&lt;/strong&gt; for our resources. Now as the term suggests, that we pay for only &lt;em&gt;those units of Computing power and resources that our application uses&lt;/em&gt;. Also, extra usage of resources is prevented by them only through the feature of &lt;strong&gt;Auto-Scaling&lt;/strong&gt; (Discussed in the next point) , which in turn reduces the risk of Increased Cost for the product.&lt;/li&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Auto Scaling&lt;/u&gt;:&lt;/h4&gt; Almost every cloud service provides us with the feature of &lt;strong&gt;"Auto Scaling"&lt;/strong&gt; . The term refers to the phenomenon through which the &lt;strong&gt;number of Resources allocated&lt;/strong&gt; to your service at any moment of time is decided by the factor of the &lt;strong&gt;Incoming Traffic&lt;/strong&gt; .
Let's understand with an example!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Let's say you have an &lt;strong&gt;E-Commerce Website&lt;/strong&gt; serving an average of &lt;strong&gt;10K Customers&lt;/strong&gt; everyday. But during the Festival Days like Diwali, Christmas etc. the Traffic suddenly rises to &lt;strong&gt;300-400K&lt;/strong&gt;. Now how would you handle that? You definitely need to &lt;strong&gt;increase the Resources of your server&lt;/strong&gt; . But again when the rush decreases, you don't need that much of computing power and so we need to &lt;strong&gt;deallocate&lt;/strong&gt; them for avoiding increased cost (&lt;em&gt;Otherwise you are gonna end Bankrupt!&lt;/em&gt; ☠️☠️). The most beautiful part of using a Cloud Service is that all of these &lt;em&gt;upscaling&lt;/em&gt; and &lt;em&gt;downscaling&lt;/em&gt; of Resources is handled by them itself and we as a user need not give any input for those. It &lt;em&gt;automatically detects the change in Incoming Traffic&lt;/em&gt; and does the needful for serving it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Speed and Availability&lt;/u&gt;:&lt;/h4&gt; Through the Cloud Service Providers we can easily use a very &lt;strong&gt;high-powered VM&lt;/strong&gt; or any other resources to cater to our needs of the customer by &lt;em&gt;increasing the computational speed&lt;/em&gt; and thus making the &lt;strong&gt;UX(&lt;em&gt;User Experience&lt;/em&gt;)&lt;/strong&gt; way better than before. Also, since the Cloud Resources are &lt;strong&gt;distributed throughout the globe&lt;/strong&gt;, we can easily configure the location and other stuffs so that customers can be served more easily and quickly from their &lt;strong&gt;nearest data center&lt;/strong&gt; for much &lt;strong&gt;decreased latency&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Security&lt;/u&gt;:&lt;/h4&gt; Since the whole infrastructure is managed by the Cloud Provider itself, so we need to have almost 0% concern of Security for our product. We can easily configure some &lt;strong&gt;security and access rules and regulations&lt;/strong&gt; through the Dashboard to mitigate the potential threats of security breach in our product.&lt;/li&gt;
&lt;li&gt;

&lt;h4&gt;
&lt;u&gt;Monitoring and Health Checkup&lt;/u&gt;:&lt;/h4&gt; While developing a &lt;em&gt;Scalable and Distributed System&lt;/em&gt; , it is very important to monitor the &lt;strong&gt;health of each of the Computing services and resources&lt;/strong&gt; so that our customer doesn't have to face an irritating &lt;strong&gt;404&lt;/strong&gt; status page.Well, Cloud Providers also have a solution for that. All the resources allocated are &lt;em&gt;continuously monitored&lt;/em&gt; and if something goes wrong, we will be immeditely notified. Also, if some service goes down, it is automatically &lt;strong&gt;restarted&lt;/strong&gt; or &lt;strong&gt;reallocated&lt;/strong&gt; on-the-fly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to use Cloud Computing?
&lt;/h2&gt;

&lt;p&gt;This is the most important section of any Technical Domain.Just because something exists, doesn't necessarily mean that we have to always use it in our products. &lt;/p&gt;

&lt;p&gt;For experimentation, we can use Cloud Computing Facilties with &lt;strong&gt;small to medium sized projects&lt;/strong&gt; but that's not a must.&lt;/p&gt;

&lt;p&gt;But for a &lt;strong&gt;&lt;em&gt;Production Level Application&lt;/em&gt;&lt;/strong&gt; which involves a lot of features like &lt;strong&gt;User Authentication&lt;/strong&gt; , &lt;strong&gt;Database Activities&lt;/strong&gt; , &lt;strong&gt;User Activity Tracking&lt;/strong&gt;, &lt;strong&gt;Feedback&lt;/strong&gt;, &lt;strong&gt;Analytics&lt;/strong&gt; etc., using Cloud Computing is a must. It not only helps us manage things efficiently but also reduces the overall time of shipping the whole product to the end users.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>API through the Eyes of a Beginner</title>
      <dc:creator>KrishnenduDG</dc:creator>
      <pubDate>Mon, 13 Feb 2023 12:42:31 +0000</pubDate>
      <link>https://forem.com/krishnendudg/api-through-the-eyes-of-a-beginner-59g4</link>
      <guid>https://forem.com/krishnendudg/api-through-the-eyes-of-a-beginner-59g4</guid>
      <description>&lt;p&gt;First Things First..&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;This article has no prerequisites except the Request-Response Cycle which I have described in my previous &lt;a href="https://dev.to/crazycoder122/a-beginners-guide-to-http-https-2hj2"&gt;Blog&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This Article may seem a little bit longer and may seem a bit boring but once you get through it, I gurantee that you will never regret your time and would be at least conceptually familiar and confident in the field of API, and you can easily get that push within yourself to build one of your own.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introduction to APIs:
&lt;/h2&gt;

&lt;p&gt;So what on earth is &lt;strong&gt;Application Programming Interface(API)&lt;/strong&gt; ?&lt;/p&gt;

&lt;p&gt;Application Programming Interface(API) , as the name suggests, is an &lt;strong&gt;&lt;em&gt;Interface&lt;/em&gt;&lt;/strong&gt; over which we can build our Application.&lt;/p&gt;

&lt;p&gt;Now this may seem a bit complicated. So, let’s break it down!&lt;/p&gt;

&lt;p&gt;Basically, API can be seen as a piece of code which has already been written by someone to be used by others for making their Applications.&lt;/p&gt;

&lt;p&gt;That piece of code can be easily used in our application (without us being concerned on how the hell the internal mechanisms are going on!!) and which provides lots of data or functionalities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz86nqur15wrnstgy2vqr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz86nqur15wrnstgy2vqr.jpg" alt="API Meme" width="735" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of APIs:
&lt;/h2&gt;

&lt;p&gt;Formally we do not differentiate APIs in the way I am now going to explain. But for the in-depth understanding maybe I feel its a lil bit easy..&lt;/p&gt;

&lt;p&gt;So, do you think that the term API is related with Web?&lt;/p&gt;

&lt;p&gt;If Yes, then maybe this section is mostly meant for you.&lt;/p&gt;

&lt;p&gt;The correct answer being No!! Though Web APIs are mostly talked about but there are also other kinds of APIs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Framework APIs:&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, let’s say you are building a Mobile App and you wanna add some functionality which involves &lt;em&gt;camera&lt;/em&gt;. Now how will you access the Camera within your code and achieve the intended functionality?&lt;/p&gt;

&lt;p&gt;There comes the use of Framework APIs. The Android Framework provides us with a &lt;strong&gt;Camera API&lt;/strong&gt; which can be used to access the Camera and get the most used functionalities like clicking pics, etc. readymade.&lt;/p&gt;

&lt;p&gt;You can explore a lot about Framework APIs by searching with the following topics like &lt;strong&gt;React Context API&lt;/strong&gt;, &lt;strong&gt;Javascript Fetch API&lt;/strong&gt;, &lt;strong&gt;React Component API&lt;/strong&gt;. If you get stuck in any of these, just hit me up once.. Will be more than happy to help!!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Web APIs:&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since, you have come until this blog, so I am assuming that you have a basic knowledge about the definitions and differences between &lt;em&gt;Frontend&lt;/em&gt; and &lt;em&gt;Backend&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So, Web APIs are basically used to connect our &lt;em&gt;Backend&lt;/em&gt;(Server Side Functionality) with the Fronted we are building. Our Backend may consist of very &lt;em&gt;complex data operations&lt;/em&gt;, &lt;em&gt;user authentications&lt;/em&gt; etc. which needs to be integrated with the Frontend and there comes the role of APIs.&lt;/p&gt;

&lt;p&gt;Basically, Web APIs is like a Messiah which saves a lot of work and finally we can build a website, which is &lt;em&gt;Dynamic&lt;/em&gt; in terms of Data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgepkh3h1ozlack0k0ay7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgepkh3h1ozlack0k0ay7.png" alt="Web API" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Web APIs:
&lt;/h2&gt;

&lt;p&gt;Primarily Web APIs can be classified into 2 types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;SOAP&lt;/em&gt; APIs&lt;/strong&gt; (Simple Object Access Protocol)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;REST&lt;/em&gt; APIs&lt;/strong&gt; (Representational State Transfer)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In today’s scenario, REST APIs are much widepread in the industry than SOAP APIs due to a number of reasons like &lt;strong&gt;Support for variety of contents including &lt;em&gt;JSON&lt;/em&gt; and &lt;em&gt;XML&lt;/em&gt;&lt;/strong&gt;(the only content type supported by &lt;em&gt;SOAP APIs&lt;/em&gt;), &lt;strong&gt;performance&lt;/strong&gt;, etc.&lt;/p&gt;

&lt;p&gt;Throughout this Blog, our main focus will be on REST APIs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwv84z5k8kfm9yml0eqwb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwv84z5k8kfm9yml0eqwb.jpg" alt="SOAP vs REST" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  REST APIs and its Components:
&lt;/h2&gt;

&lt;p&gt;REST APIs are the backbone of today’s Web Industry. They operate over &lt;strong&gt;HTTP and HTTPS Protocol&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They support a lot of content type like &lt;strong&gt;Text/HTML&lt;/strong&gt;, &lt;strong&gt;JSON&lt;/strong&gt;, &lt;strong&gt;Image&lt;/strong&gt; etc.&lt;/p&gt;

&lt;p&gt;REST APIs are always &lt;strong&gt;Stateless&lt;/strong&gt;, i.e. , the backend server does not have to keep track of the previous requests to validate and send/receive data for the current request.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Return Type&lt;/strong&gt; of the current Request is decided &lt;em&gt;on-the-fly&lt;/em&gt; depending on the info provided through the URL and the Body(explained in the later part of this Blog)&lt;/p&gt;

&lt;p&gt;Enough of the Theoretical Aspect of it!!&lt;/p&gt;

&lt;p&gt;Now let’s focus on the Practical Part of APIs and try to understand the exact anatomy of it.&lt;/p&gt;

&lt;p&gt;It consists of mainly &lt;em&gt;6 main components&lt;/em&gt;:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. An Endpoint:
&lt;/h4&gt;

&lt;p&gt;The REST APIs operate over &lt;strong&gt;&lt;em&gt;URIs&lt;/em&gt;&lt;/strong&gt;(&lt;em&gt;Universal Resource Identifier&lt;/em&gt;) to fetch and store informations from the server and there comes the play of &lt;strong&gt;Endpoint&lt;/strong&gt;. We know that every server has their own fixed &lt;strong&gt;domain names&lt;/strong&gt; attached to them like &lt;a href="//www.google.com"&gt;www.google.com&lt;/a&gt;, &lt;a href="//www.medium.com"&gt;www.medium.com&lt;/a&gt; etc.&lt;/p&gt;

&lt;p&gt;On top of that, we see a /(&lt;strong&gt;Forward slash&lt;/strong&gt;) followed by some &lt;em&gt;big address&lt;/em&gt; and that is the &lt;strong&gt;Endpoint&lt;/strong&gt; itself.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Domain name&lt;/strong&gt; helps us to locate the Server and the endpoint helps us to locate some &lt;strong&gt;particular specific resource&lt;/strong&gt; within that server.&lt;/p&gt;

&lt;p&gt;Let’s understand it through an example..&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your friend lives at 21B Burdwan Road,Alipore, Kolkata-700003.&lt;br&gt;
Now to reach his house is it sufficient to know that he lives in &lt;strong&gt;Kolkata&lt;/strong&gt;?&lt;br&gt;
Nope!! You need to know his full address.&lt;br&gt;
So, here &lt;strong&gt;&lt;em&gt;Kolkata&lt;/em&gt;&lt;/strong&gt; is like the &lt;strong&gt;&lt;em&gt;Domain Name&lt;/em&gt;&lt;/strong&gt; and the &lt;strong&gt;&lt;em&gt;rest of his address&lt;/em&gt;&lt;/strong&gt; is the &lt;strong&gt;&lt;em&gt;Endpoint&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mjqqzoidl376r8zba91.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mjqqzoidl376r8zba91.jpg" alt="Endpoint" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. A Method:
&lt;/h4&gt;

&lt;p&gt;This is one of the most important component of the REST APIs.&lt;/p&gt;

&lt;p&gt;It specifies the &lt;strong&gt;Mode of Operation&lt;/strong&gt; to be performed by the API on the server-side for this Incoming Request.&lt;/p&gt;

&lt;p&gt;The Methods which are mostly talked about are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;GET&lt;/em&gt;&lt;/strong&gt; (Get the Resource)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;POST&lt;/em&gt;&lt;/strong&gt; (Create a new Resource)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;PUT&lt;/em&gt;&lt;/strong&gt; (Update a Resource) ,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;PATCH&lt;/em&gt;&lt;/strong&gt; (Almost similar to &lt;em&gt;PUT&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;DELETE&lt;/em&gt;&lt;/strong&gt; (Delete a Resource)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;OPTIONS&lt;/em&gt;&lt;/strong&gt; (Get all the allowed Methods for the Particular Endpoint).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, the most interesting part of it is that we can achieve all these Methods using only 1 single method and that is &lt;strong&gt;POST&lt;/strong&gt;. Every Method (except &lt;strong&gt;OPTIONS&lt;/strong&gt;) can be implemented using POST Request.&lt;/p&gt;

&lt;p&gt;Then the Question arises, why we are learning so many Methods? Would simulating all the other types of Requests using POST break my API?&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;NO&lt;/strong&gt;. You can successfully achieve every Method using POST but the problem comes with &lt;strong&gt;scalability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you have to deal with &lt;em&gt;numerous endpoints and Resources&lt;/em&gt;, it becomes a horrendous task to maintain a bunch of POST requests.&lt;/p&gt;

&lt;p&gt;Instead if we can categorise the Requests using the Methods, the code becomes much &lt;strong&gt;cleaner&lt;/strong&gt; and &lt;strong&gt;managable&lt;/strong&gt; easily.&lt;/p&gt;

&lt;p&gt;Also, it makes much more of human sense to use a DELETE Method to delete a Particular Resource in the server than to naively sending a POST Request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbs96pe87hbk9thr9wlzm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbs96pe87hbk9thr9wlzm.jpg" alt="API Method" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Headers:
&lt;/h4&gt;

&lt;p&gt;Ever Inspected an API Call through browser? If Yes, then at least once, you have been terrified by the bunch of &lt;em&gt;Headers&lt;/em&gt; sent and received while making that call and wondered about their usage.&lt;/p&gt;

&lt;p&gt;Coming to the point of their applications, there are a lots. But generally speaking, the Headers simply define &lt;em&gt;how the API Response should be and other stuffs&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Some of the few common Headers are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content-Type:&lt;/strong&gt; It specifies the &lt;em&gt;type of data&lt;/em&gt; that client must expect from the server side so that it can render it properly. Common values include &lt;strong&gt;“Text/HTML”&lt;/strong&gt;, &lt;strong&gt;“Application/JSON”&lt;/strong&gt; etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authorisation Headers:&lt;/strong&gt; These headers serve as the carrier of &lt;strong&gt;Authorisation&lt;/strong&gt; and &lt;strong&gt;Authentication&lt;/strong&gt; information to the servers. The &lt;em&gt;Auth Token&lt;/em&gt; or the &lt;strong&gt;Bearer Token&lt;/strong&gt; is sent from the client to the server. If the credentials are found to be valid, then the server returns the desired Response else throws an &lt;em&gt;“Unauthorised”&lt;/em&gt; Response.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache-Control:&lt;/strong&gt; It simply defines the &lt;strong&gt;caching policy of the server&lt;/strong&gt; and till how much time the client can rely on the &lt;em&gt;pre-fetched data&lt;/em&gt; before it gets stale.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;access-control-allow-credentials: true
access-control-allow-headers: X-Playlog-Web
access-control-allow-origin: https://ogs.google.com
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
cache-control: private
content-encoding: gzip
content-length: 131
content-type: text/plain; charset=UTF-8
cross-origin-resource-policy: cross-origin
date: Tue, 07 Feb 2023 21:28:10 GMT
expires: Tue, 07 Feb 2023 21:28:10 GMT
server: Playlog
x-frame-options: SAMEORIGIN
x-xss-protection: 0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4.Body:
&lt;/h4&gt;

&lt;p&gt;This is the most Important part of any API. It basically contains the whole &lt;em&gt;chunk of data&lt;/em&gt; sent from the client to the server.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;For Example, while creating a new Resource using POST Request, we specify the details of the Resource to be created through the Body of the API. The Server then fetches the whole request body, manipulates it accordingly and thereby stores it in the Database.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name" : "John Doe", 
  "age" : 30,
  "gender" :"Male"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  5. Parameters:
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Not to be confused with Endpoint. They may seem similar but they are not functionally!!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Endpoints take us to the specific resource but for &lt;strong&gt;further clarification&lt;/strong&gt; and &lt;strong&gt;filtering&lt;/strong&gt;, we need the &lt;strong&gt;Query Parameters&lt;/strong&gt; to be passed with the URL.&lt;/p&gt;

&lt;p&gt;Let’s get back to the previous example..&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You have reached your friend’s house successfully using his &lt;strong&gt;Residential Address&lt;/strong&gt;(&lt;strong&gt;Endpoint&lt;/strong&gt; in this scenario). His family consists of 5 members.&lt;br&gt;
What would you do to meet your friend among all the members? You will tell his name.&lt;br&gt;
And there comes the &lt;strong&gt;Query Parameters(Friend’s name in this case)&lt;/strong&gt; . You have reached a particular location in the server where there are many resources. Now you want to do some specific operation with some specific Resource. You just have to clarify that to the server using &lt;strong&gt;Query Parameters&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpgv0dp2225fxgfnx6lk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpgv0dp2225fxgfnx6lk.jpg" alt="Query Parameters" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  6. Status Codes:
&lt;/h4&gt;

&lt;p&gt;All of us, whether a Web Developer or not, have at least once faced the &lt;strong&gt;&lt;em&gt;404 PAGE&lt;/em&gt;&lt;/strong&gt; in life. Isn’t it frustrating? But have you ever wondered why we call it as 404 and not anything else?&lt;/p&gt;

&lt;p&gt;What is so special about this number (except it being a Palindrome Number lol!!) ?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm3nzecogxvyyw3kltpf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm3nzecogxvyyw3kltpf.jpg" alt="404 Error Page" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Till now, we have got to know about the whole journey of an API call almost. But when the &lt;em&gt;Response&lt;/em&gt; is sent from the server to the client, does it contain only the raw chunk of Data and Headers? or something else is embedded in it?&lt;/p&gt;

&lt;p&gt;Yes.. Some &lt;strong&gt;&lt;em&gt;Numeric Codes&lt;/em&gt;&lt;/strong&gt; are embedded within the Response to specify whether the call has been successful or not. If &lt;strong&gt;unsuccessful&lt;/strong&gt;, then the codes also provides us a deep insight as to &lt;em&gt;on what ground did the request fail&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;For all of the Status Codes and their meanings, refer to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status" rel="noopener noreferrer"&gt;MDN Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5kc1hklcqghyfrg94rpm.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5kc1hklcqghyfrg94rpm.jpeg" alt="HTTP Status Codes" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I Guess now you are confident enough over the Topic of &lt;strong&gt;APIs&lt;/strong&gt; and maybe aspiring to make one of our own. For any kind of Doubts, don’t ever hesitate to contact me for clarification.&lt;/p&gt;

&lt;p&gt;Hope that you enjoyed reading through the Article.&lt;/p&gt;

&lt;p&gt;Feedbacks are welcome.&lt;/p&gt;

&lt;p&gt;Have a Good Day :) :)&lt;/p&gt;

&lt;p&gt;Image Courtsey — &lt;strong&gt;Google Images&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>A Beginner’s Guide to HTTP &amp; HTTPS</title>
      <dc:creator>KrishnenduDG</dc:creator>
      <pubDate>Wed, 08 Feb 2023 08:54:30 +0000</pubDate>
      <link>https://forem.com/krishnendudg/a-beginners-guide-to-http-https-2hj2</link>
      <guid>https://forem.com/krishnendudg/a-beginners-guide-to-http-https-2hj2</guid>
      <description>&lt;p&gt;Probably everyone, at least who are attached to the field of Web Development in some way, have definitely heard the two very famous terms, &lt;strong&gt;HTTP&lt;/strong&gt; and &lt;strong&gt;HTTPS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Today, we are going to take a look at the different aspects of these topics. But let’s first start our journey with the &lt;strong&gt;Request-Response Cycle&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Request-Response Cycle:
&lt;/h2&gt;

&lt;p&gt;The whole Ecosystem of Internet has its pivot in this well-known phenomenon of &lt;em&gt;Request-Response Cycle&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Maybe a lot of new terms for a beginner, but once read thoroughly, it makes the life of a beginner Web Developer much easy.&lt;/p&gt;

&lt;p&gt;Formally, it is defined as the &lt;strong&gt;flow of information&lt;/strong&gt; between &lt;strong&gt;&lt;em&gt;clients&lt;/em&gt;&lt;/strong&gt;(Spread across the world) and the &lt;strong&gt;&lt;em&gt;server&lt;/em&gt;&lt;/strong&gt;(&lt;strong&gt;centralised&lt;/strong&gt; in case of &lt;strong&gt;Web2.0&lt;/strong&gt; but &lt;strong&gt;decentralised&lt;/strong&gt; in case of &lt;strong&gt;Web3.0&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;Let’s take an example to understand it more clearly.&lt;/p&gt;

&lt;p&gt;Whenever we type any &lt;strong&gt;URL&lt;/strong&gt; in the search bar and then press Enter Key, the typed URL is sent to &lt;strong&gt;DNS Server&lt;/strong&gt; of your &lt;em&gt;ISP(&lt;strong&gt;Internet Service Provider&lt;/strong&gt;)&lt;/em&gt; which then maps the URL to the corresponding IP Address. Once the &lt;strong&gt;IP Address&lt;/strong&gt; is fetched, a &lt;strong&gt;Request&lt;/strong&gt; to the Server is made for the necessary details and it sends us back the Data or Webpage as a &lt;strong&gt;Response&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In short, it is the whole phenomenon of &lt;em&gt;initiating&lt;/em&gt; a &lt;strong&gt;Web Request&lt;/strong&gt; for getting the necessary &lt;strong&gt;Response&lt;/strong&gt; from the Backend Server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk24di0cczig9c04zqsil.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk24di0cczig9c04zqsil.jpg" alt="Request-Response Cycle" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Protocols:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Web Protocols&lt;/em&gt; are basically the set of rules that governs features, some of which are listed below :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Will the connection be kept alive after a certain action or a period of time?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whether the flow of data is Unidirectional or not?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whether the whole Data flow be realtime or not?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some most commonly used Web Protocols are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTPS&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WS&lt;/strong&gt; (Used in Handling &lt;em&gt;Web Sockets&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSH&lt;/strong&gt; (Used in connecting to a &lt;em&gt;Remote shell&lt;/em&gt;)    &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  HTTP and HTTPS:
&lt;/h2&gt;

&lt;p&gt;As per &lt;strong&gt;MDN Docs&lt;/strong&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Hypertext Transfer Protocol (HTTP)&lt;/strong&gt; is a web protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between &lt;strong&gt;web browsers&lt;/strong&gt; and &lt;strong&gt;web servers&lt;/strong&gt;, but it can also be used for other purposes. HTTP follows a classical &lt;strong&gt;client-server model&lt;/strong&gt;, with a client opening a connection to make a request, then waiting until it receives a response.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;HTTPS is basically an extension of HTTP that adds an extra layer of security by &lt;strong&gt;encrypting&lt;/strong&gt; the data being transferred between a &lt;strong&gt;web server&lt;/strong&gt; and a &lt;strong&gt;browser&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When a user connects to a website using HTTPS, their connection to the website is encrypted using &lt;strong&gt;SSL(&lt;em&gt;Secure Sockets layer&lt;/em&gt;)&lt;/strong&gt; or &lt;strong&gt;TLS(&lt;em&gt;Transport layer Security&lt;/em&gt;)&lt;/strong&gt;. This makes it much more difficult for hackers to intercept and steal &lt;strong&gt;sensitive information&lt;/strong&gt; such as &lt;em&gt;login credentials&lt;/em&gt;, &lt;em&gt;credit card information&lt;/em&gt;, or &lt;em&gt;personal data&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpijzrjrem2knsjdmcd9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpijzrjrem2knsjdmcd9u.png" alt="HTTP and HTTPS" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SSL:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SSL (Secure Sockets Layer)&lt;/strong&gt; and its successor, &lt;strong&gt;TLS (Transport Layer Security)&lt;/strong&gt;, are protocols for establishing &lt;em&gt;authenticated&lt;/em&gt; and encrypted links between networked computers.&lt;/p&gt;

&lt;p&gt;In order to establish an SSL connection, a website must first obtain an &lt;strong&gt;SSL Certificate&lt;/strong&gt; from a trusted &lt;em&gt;certificate authority&lt;/em&gt; (CA). This certificate is used to authenticate the identity of the website, and to prove that the website’s domain name belongs to the organization that requested the certificate.&lt;/p&gt;

&lt;p&gt;Once a website has an SSL certificate, it can configure its web server to use &lt;strong&gt;SSL&lt;/strong&gt; for all connections to the website. When a user connects to the website using HTTPS, their browser will verify the &lt;em&gt;SSL certificate&lt;/em&gt; and establish an &lt;strong&gt;SSL connection&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqy8w56fxrn3kl32kqba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqy8w56fxrn3kl32kqba.png" alt="SSL" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Location of HTTP/HTPPS in the Network Model:
&lt;/h2&gt;

&lt;p&gt;As per the &lt;strong&gt;&lt;em&gt;OSI Model of Networking&lt;/em&gt;&lt;/strong&gt;, The &lt;em&gt;HTTP/HTTPS&lt;/em&gt; Protocols are both located in the &lt;strong&gt;Application layer&lt;/strong&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
