<?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>DEV Community: Gaurav Kumar Shah</title>
    <description>The latest articles on DEV Community by Gaurav Kumar Shah (@krugarr).</description>
    <link>https://dev.to/krugarr</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%2F739639%2F8accbce8-2471-449a-9f7a-dddda5e9ab81.png</url>
      <title>DEV Community: Gaurav Kumar Shah</title>
      <link>https://dev.to/krugarr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krugarr"/>
    <language>en</language>
    <item>
      <title>HTTP, HTTPs and APIs</title>
      <dc:creator>Gaurav Kumar Shah</dc:creator>
      <pubDate>Wed, 25 Jan 2023 14:39:06 +0000</pubDate>
      <link>https://dev.to/krugarr/http-https-and-apis-5h73</link>
      <guid>https://dev.to/krugarr/http-https-and-apis-5h73</guid>
      <description>&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%2Fbxwm2ii0b38il67k0c2f.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%2Fbxwm2ii0b38il67k0c2f.png" alt="Image description" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HTTP (Hypertext Transfer Protocol) is a protocol used for transferring data over the internet. It is the foundation of the World Wide Web and is used for communication between clients and servers.&lt;/p&gt;

&lt;p&gt;An API (Application Programming Interface) is a set of rules and protocols for building and interacting with software applications. It specifies how software components should interact and APIs allow for communication between different systems.&lt;/p&gt;

&lt;p&gt;APIs often use HTTP as the communication protocol and a specific format such as JSON or XML to structure the data being transferred. An example of this is when a client (such as a mobile app) sends an HTTP request to a server (such as a web application) to retrieve or update some data, the server will respond with an HTTP response, which includes the requested data in a specific format (such as JSON).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Package Interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;API stands for "Application Programming Interface." In simple terms, an API is a set of rules and protocols that allows different software applications to communicate with each other.&lt;/p&gt;

&lt;p&gt;Think of an API like a menu in a restaurant. The menu provides a list of options that the kitchen (the back-end of the restaurant) can prepare. Similarly, an API provides a list of endpoints (or "options") that a software application (the back-end) can respond to.&lt;/p&gt;

&lt;p&gt;For example, imagine you are building a mobile app that needs to display information about the current weather. Instead of building the functionality to gather weather data from scratch, you can use an API that provides weather information. You would make an API call to the weather API and it would respond with the current weather data in a specific format, like JSON.&lt;/p&gt;

&lt;p&gt;APIs are widely used in modern software development to allow different systems and applications to share data and functionality, without requiring direct access to the underlying systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an HTTP request and HTTP response?&lt;/strong&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%2Fg8frj0hhkehsvhlzf9uq.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%2Fg8frj0hhkehsvhlzf9uq.png" alt="Image description" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HTTP (Hypertext Transfer Protocol) is the protocol used for communication between web browsers and servers. An HTTP request is a message sent by a client (such as a web browser) to a server, asking for information or requesting a specific action. An HTTP response is the message sent back by the server in response to an HTTP request.&lt;/p&gt;

&lt;p&gt;An HTTP request typically consists of a method, a URI (Uniform Resource Identifier), and headers that provide additional information about the request. The most common methods are GET, which requests a specific resource, and POST, which sends data to the server to be processed.&lt;/p&gt;

&lt;p&gt;An HTTP response typically consists of a status code, headers, and a message body. The status code is a 3-digit number that indicates the outcome of the request, such as 200 (OK) for a successful request or 404 (Not Found) for a request that cannot be fulfilled. The headers provide additional information about the response, such as the content type and length of the message body. The message body contains the information requested by the client, such as the HTML code of a webpage.&lt;/p&gt;

&lt;p&gt;Both the request and response are sent in plain text, which makes it easy for developers to read and debug them. HTTP is widely used for communication over the internet and it's the foundation of the World Wide Web (WWW).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP vs HTTPS&lt;/strong&gt;&lt;br&gt;
HTTP (Hypertext Transfer Protocol) is the standard protocol for transmitting data over the internet. It is used for communication between a web browser and a web server. HTTPS (HTTP Secure) is an extension of HTTP that adds an additional layer of security by using SSL (Secure Socket Layer) or TLS (Transport Layer Security) to encrypt the data being transmitted. &lt;br&gt;
This makes it much more difficult for attackers to intercept and read the information being sent. In general, HTTPS is used for sites that handle sensitive information, such as online stores or banking sites, while HTTP is used for less sensitive information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Different methods in APIs&lt;/strong&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%2F4amlcm7azyvo62jn8rnk.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%2F4amlcm7azyvo62jn8rnk.png" alt="Image description" width="686" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API (Application Programming Interface) methods are the different ways in which a computer program can interact with an API. The most commonly used API methods are:&lt;/li&gt;
&lt;li&gt;GET: Retrieves information from a server. For example, a GET request to a weather API would return the current temperature and forecast.&lt;/li&gt;
&lt;li&gt;POST: Sends new information to a server. For example, a POST request to a social media API could be used to post a new status update.&lt;/li&gt;
&lt;li&gt;PUT: Updates existing information on a server. For example, a PUT request to an e-commerce API could be used to update the quantity of an item in a shopping cart.&lt;/li&gt;
&lt;li&gt;DELETE: Deletes information from a server. For example, a DELETE request to a social media API could be used to delete a post.&lt;/li&gt;
&lt;li&gt;PATCH: Partial update existing information on a server. For example, a PATCH request to a user profile API could update user's address.&lt;/li&gt;
&lt;li&gt;These are the most commonly used API methods, but there may be others depending on the API and their use-cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Migrating APIs to HTTPS&lt;/strong&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%2F5lumz7qteesdumf1dlwh.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%2F5lumz7qteesdumf1dlwh.png" alt="Image description" width="317" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Migrating an API from HTTP to HTTPS involves a few steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Obtain an SSL/TLS certificate: This is a digital certificate that is used to establish a secure connection between the client and the server. You can obtain a certificate from a certificate authority (CA) or use a free one from Let's Encrypt.&lt;/li&gt;
&lt;li&gt;Update your server configuration: Once you have your certificate, you will need to configure your web server to use it. This typically involves specifying the location of the certificate and private key files, as well as configuring the server to listen on port 443 (the default port for HTTPS) instead of port 80 (the default for HTTP).&lt;/li&gt;
&lt;li&gt;Update your application code: If your application is hardcoded to use HTTP, you will need to update it to use HTTPS. This may involve changing the URLs used in your application, as well as any redirects or links that point to your API.&lt;/li&gt;
&lt;li&gt;Test your application: Before deploying your changes to production, it's a good idea to thoroughly test your application to make sure that everything is working as expected. This includes testing the SSL/TLS handshake and encryption, as well as testing all of the endpoints and functionality of your API.&lt;/li&gt;
&lt;li&gt;Update your API documentation: It's important to update any documentation or developer resources related to your API to reflect the change to HTTPS. This includes updating the base URL of your API and any examples or code snippets to use the HTTPS protocol.&lt;/li&gt;
&lt;li&gt;Update any clients using your API to use HTTPS: any apps, websites, or systems that consume your API will also need to be updated to use HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's important to note that migrating to HTTPS may have an impact on the performance of your API, as the SSL/TLS encryption adds an additional overhead. To minimize this impact, consider using an HTTP/2 or QUIC protocol that uses the same encryption as HTTPS but is more efficient.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>APIs: 101</title>
      <dc:creator>Gaurav Kumar Shah</dc:creator>
      <pubDate>Mon, 23 Jan 2023 13:48:40 +0000</pubDate>
      <link>https://dev.to/krugarr/apis-101-4i93</link>
      <guid>https://dev.to/krugarr/apis-101-4i93</guid>
      <description>&lt;p&gt;HTTP (Hypertext Transfer Protocol) is a protocol used for transferring data over the internet. It is the foundation of the World Wide Web and is used for communication between clients and servers.&lt;/p&gt;

&lt;p&gt;An API (Application Programming Interface) is a set of rules and protocols for building and interacting with software applications. It specifies how software components should interact and APIs allow for communication between different systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an API?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;API stands for "Application Programming Interface." In simple terms, an API is a set of rules and protocols that allows different software applications to communicate with each other.&lt;/p&gt;

&lt;p&gt;I know this is one of the standard definition for APIs on web. Let's understand this with a popular analogy. Think of an API like a menu in a restaurant. The menu provides a list of options that the kitchen (the back-end of the restaurant) can prepare. Similarly, an API provides a list of endpoints (or "options") that a software application (the back-end) can respond to.&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%2F7ca46iav0l5axrhxb58g.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%2F7ca46iav0l5axrhxb58g.png" alt="What is an API?" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, imagine you are building a mobile app that needs to display information about the current weather. Instead of building the functionality to gather weather data from scratch, you can use an API that provides weather information. You would make an API call to the weather API and it would respond with the current weather data in a specific format, like JSON.&lt;/p&gt;

&lt;p&gt;APIs are widely used in modern software development to allow different systems and applications to share data and functionality, without requiring direct access to the underlying systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some Basic terminologies of APIs&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%2F1kzq7j1cb0x92vv9ygfd.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%2F1kzq7j1cb0x92vv9ygfd.png" alt="APIs terminologies" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some basic terms commonly used when discussing APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Endpoint: An endpoint is a specific URL that an API call is made to. It is the location where the desired resource is located.&lt;/li&gt;
&lt;li&gt;Request: An API request is the message sent by the client to the server to retrieve or update information.&lt;/li&gt;
&lt;li&gt;Response: An API response is the message sent by the server in response to an API request. It contains the requested information or an error message.&lt;/li&gt;
&lt;li&gt;Resource: A resource is a specific data item or collection of items that can be retrieved or manipulated using an API.&lt;/li&gt;
&lt;li&gt;Method: An API method is the type of request being made to an endpoint, such as a GET request to retrieve data, or a POST request to submit data (We will discuss more on this later).&lt;/li&gt;
&lt;li&gt;Authentication: Authentication is the process of verifying the identity of the client making an API request. It can be done with a token or a key.&lt;/li&gt;
&lt;li&gt;Rate Limiting: The number of requests that a client can make to an API within a specified time period.&lt;/li&gt;
&lt;li&gt;SDK: SDK stands for "Software Development Kit", is a set of tools and libraries provided by the API provider to make it easier to integrate with their API.&lt;/li&gt;
&lt;li&gt;JSON: JSON (JavaScript Object Notation) is a common format for sending and receiving data through APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are just a few of the terms commonly used when discussing APIs, but there are many more. Understanding these basic terms will help you understand how APIs work and how to use them effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Different methods in APIs&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%2F3nkhrffwix8tdauj1dn4.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%2F3nkhrffwix8tdauj1dn4.png" alt="Methods in APIs" width="686" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API (Application Programming Interface) methods are the different ways in which a computer program can interact with an API. The most commonly used API methods are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GET: Retrieves information from a server. For example, a GET request to a weather API would return the current temperature and forecast.&lt;/li&gt;
&lt;li&gt;POST: Sends new information to a server. For example, a POST request to a social media API could be used to post a new status update.&lt;/li&gt;
&lt;li&gt;PUT: Updates existing information on a server. For example, a PUT request to an e-commerce API could be used to update the quantity of an item in a shopping cart.&lt;/li&gt;
&lt;li&gt;DELETE: Deletes information from a server. For example, a DELETE request to a social media API could be used to delete a post.&lt;/li&gt;
&lt;li&gt;PATCH: Partial update existing information on a server. For example, a PATCH request to a user profile API could update user's address.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the most commonly used API methods, but there may be others depending on the API and their use-cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIs based on HTTP:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The most commonly used API based on HTTP is the XMLHttpRequest API, which can be used to exchange data between a user agent and a server.&lt;/li&gt;
&lt;li&gt;The modern Fetch API provides the same features with a more powerful and flexible feature set.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, we can say that HTTP is an extensible protocol that is easy to use. The client-server structure, combined with the ability to add headers, allows HTTP to advance along with the extended capabilities of the Web.&lt;/p&gt;

</description>
      <category>github</category>
      <category>bug</category>
      <category>help</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
