<?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: Archit Sharma</title>
    <description>The latest articles on Forem by Archit Sharma (@iarchitsharma).</description>
    <link>https://forem.com/iarchitsharma</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%2F676134%2F61430b7f-13be-4572-8ed5-4ba8f732386f.JPG</url>
      <title>Forem: Archit Sharma</title>
      <link>https://forem.com/iarchitsharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iarchitsharma"/>
    <language>en</language>
    <item>
      <title>Media types (MIME types) in HTTP explained</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Fri, 31 Oct 2025 15:56:10 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/media-types-mime-types-in-http-explained-1i26</link>
      <guid>https://forem.com/iarchitsharma/media-types-mime-types-in-http-explained-1i26</guid>
      <description>&lt;p&gt;&lt;strong&gt;Media types&lt;/strong&gt; (formerly known as a MIME types) is a standard way to describe the type and format of data being sent or received over the Internet.&lt;br&gt;
MIME types are defined and standardized in IETF's &lt;a href="https://datatracker.ietf.org/doc/html/rfc6838" rel="noopener noreferrer"&gt;RFC 6838&lt;/a&gt;.&lt;br&gt;
MIME (Multipurpose Internet Mail Extensions) it was originally defined for &lt;strong&gt;email attachments&lt;/strong&gt; but later adopted by HTTP and many other protocols.&lt;/p&gt;

&lt;p&gt;Example, when a web server sends a response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
Content-Type: text/html

&amp;lt;html&amp;gt;
  &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;The header &lt;code&gt;Content-Type: text/html&lt;/code&gt; tells the browser that the body contains HTML, so it should render it as a web page.&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%2Fugradv8at61ivkw5x3w1.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%2Fugradv8at61ivkw5x3w1.png" alt="MIME Type in browser console" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Structure of a Media Type
&lt;/h2&gt;

&lt;p&gt;A MIME/Media type consists of just two parts: a &lt;em&gt;type&lt;/em&gt; and a &lt;em&gt;subtype&lt;/em&gt;, separated by a slash (&lt;code&gt;/&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type/subtype
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;type&lt;/code&gt; is the general data category (e.g., &lt;code&gt;video&lt;/code&gt; or &lt;code&gt;text&lt;/code&gt;), while the &lt;code&gt;subtype&lt;/code&gt; is the specific format within that category (e.g., &lt;code&gt;html&lt;/code&gt; or &lt;code&gt;plain&lt;/code&gt; for the &lt;code&gt;text&lt;/code&gt; MIME type).&lt;/p&gt;

&lt;p&gt;For a complete list of all official MIME types, see the IANA (Internet Assigned Numbers Authority) &lt;a href="https://www.iana.org/assignments/media-types/media-types.xhtml" rel="noopener noreferrer"&gt;Media Types registry&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optional parameters
&lt;/h3&gt;

&lt;p&gt;Sometimes, a media type includes optional &lt;code&gt;parameter&lt;/code&gt; after a semicolon (&lt;code&gt;;&lt;/code&gt;)&lt;br&gt;
Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type/subtype;parameter=value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example: &lt;code&gt;text/plain;charset=UTF-8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;MIME types are traditionally written in lowercase, but they are case-insensitive. However, their parameter values can be case-sensitive.&lt;/p&gt;

&lt;p&gt;MIME types are divided into two major classes based on the structure of their content:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Discrete types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Discrete types represent a single file, such as a single text or music file, or a single video. It's commonly used in HTTP bodies for typical web content (HTML, JSON, images, etc.). For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;text/plain&lt;/code&gt; - plain text&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;image/jpeg&lt;/code&gt; - a JPEG image&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;application/json&lt;/code&gt; - a JSON document&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;video/mp4&lt;/code&gt; - an MP4 video file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For text documents without a specific subtype, &lt;code&gt;text/plain&lt;/code&gt; is used. For any unrecognized binary file, &lt;code&gt;application/octet-stream&lt;/code&gt; is used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Multipart types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multipart types represent a collection of multiple discrete parts, each with its own headers and MIME type, combined in a single body.&lt;br&gt;
For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;multipart/form-data&lt;/code&gt; - used in HTML forms (like file uploads)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;multipart/mixed&lt;/code&gt; - contains different types of content together&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;multipart/alternative&lt;/code&gt; - multiple representations of the same content (like HTML + plain text emails)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  MIME sniffing
&lt;/h2&gt;

&lt;p&gt;MIME sniffing is the process by which a web browser tries to determine the actual content type of a resource by inspecting its bytes&lt;br&gt;
If a MIME type is missing or seems incorrect, browsers may perform MIME sniffing.&lt;/p&gt;

&lt;p&gt;Since MIME sniffing is implemented differently in each browser and can be triggered under various circumstances, it introduces security risks. A malicious file could be misinterpreted as a safe, executable type. To mitigate this, servers can explicitly prevent sniffing by using the &lt;code&gt;X-Content-Type-Options&lt;/code&gt; header.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>http</category>
      <category>beginners</category>
      <category>security</category>
    </item>
    <item>
      <title>HTTP Request and Response explained</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Thu, 30 Oct 2025 11:45:01 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/http-request-and-response-explained-46l2</link>
      <guid>https://forem.com/iarchitsharma/http-request-and-response-explained-46l2</guid>
      <description>&lt;p&gt;In this article we will take a look at general overview of the HTTP messages.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: The HTTP message formats, methods, and semantics described in this article are based on the official IETF specifications defined in &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html" rel="noopener noreferrer"&gt;RFC 9110&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;HTTP is a stateless protocol where clients and servers exchange HTTP messages through a simple request-response cycle. A client initiates by sending a request (&lt;em&gt;containing a method, target, headers, and optional content&lt;/em&gt;). A server replies with a response (&lt;em&gt;containing a status code, headers, and optional content&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;You don't need to build HTTP messages by hand. Tools like your browser or a web server are programmed to create them correctly. Developers just use APIs and configuration files to control what those messages contain.&lt;/p&gt;

&lt;p&gt;While each HTTP version has its own message format, this article uses &lt;strong&gt;HTTP/1.1&lt;/strong&gt; messages for readability for all HTTP messages.&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%2Fkto3x19857qxz52lfy5i.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%2Fkto3x19857qxz52lfy5i.png" alt="HTTP Request &amp;amp; Response" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP Request
&lt;/h2&gt;

&lt;p&gt;An HTTP request message has following four components mentioned below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;Request-line&lt;/strong&gt;: &lt;code&gt;&amp;lt;Method&amp;gt; &amp;lt;Request-Target&amp;gt; &amp;lt;Protocol-Version&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Header&lt;/strong&gt; (General|Request|Entity) fields followed by CRLF&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;empty line&lt;/strong&gt; (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields&lt;/li&gt;
&lt;li&gt;Optionally a &lt;strong&gt;message-body&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's explore each component of an HTTP request message in detail:&lt;/p&gt;

&lt;h3&gt;
  
  
  Request Line
&lt;/h3&gt;

&lt;p&gt;The start-line in HTTP/1.x requests is called a "request-line" and is made of three parts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The request method (like GET or POST) specifies the client's intention for the request and what a successful response should accomplish.&lt;/p&gt;

&lt;p&gt;The following table lists all the supported methods in HTTP:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;The GET method is used to retrieve information from the given server using a given URI.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HEAD&lt;/td&gt;
&lt;td&gt;Same as GET, but it transfers the status line and the header section only.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;A POST request is used to send data to the server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUT&lt;/td&gt;
&lt;td&gt;PUT updates a resource by replacing all of its data with the new content sent in the request.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;Removes the target resource entirely.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CONNECT&lt;/td&gt;
&lt;td&gt;Sets up a direct network tunnel to a remote server, usually through a proxy. This is primarily used to establish HTTPS connections through a proxy.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OPTIONS&lt;/td&gt;
&lt;td&gt;Retrieves the HTTP methods and other communication options that the server supports for the target resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TRACE&lt;/td&gt;
&lt;td&gt;Performs a loop-back diagnostic test. The server echoes the received request message back to the client, allowing inspection of any modifications made by intermediaries along the path.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Request target&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Request target is used to identify which resource the client wants to interact with. The format of the request target (usually a URL) is determined by both the HTTP method being requested and whether the request is to a proxy&lt;/p&gt;

&lt;p&gt;Following are the most commonly used forms of targets:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Origin form&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The most common form of Request target, consisting of the path and optional query string: &lt;code&gt;origin-form = absolute-path [ "?" query ]&lt;/code&gt;  When contacting a server directly, clients must send only the path and query from the full URL. The domain is sent separately in the &lt;code&gt;Host&lt;/code&gt; header. Example: For &lt;code&gt;http://www.example.org/where?q=now&lt;/code&gt;, the request is:  &lt;code&gt;GET /where?q=now HTTP/1.1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Absolute form&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The absolute-form is used when sending requests through a proxy. Instead of just the path, the client sends the complete URL as the request target. Example: &lt;code&gt;GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Authority form&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The authority form is the &lt;strong&gt;host&lt;/strong&gt; and &lt;strong&gt;port&lt;/strong&gt; separated by a colon (:). It is only used with the &lt;code&gt;CONNECT&lt;/code&gt; method when setting up an HTTP tunnel. Example: &lt;code&gt;CONNECT www.example.com:80 HTTP/1.1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Asterisk form&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The asterisk-form uses just * and is used only with the &lt;code&gt;OPTIONS&lt;/code&gt; method to ask about the server’s overall capabilities, not any specific resource. Example: &lt;code&gt;OPTIONS * HTTP/1.1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Protocol Version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Protocol Version in a request is a declaration made by the client indicating both the syntax format of the message being sent and the highest level of protocol features the client can understand for future communication from the server.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn more about &lt;a href="https://dev.to/iarchitsharma/the-history-of-http-32ga"&gt;HTTP Versions&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Request Header Fields
&lt;/h3&gt;

&lt;p&gt;Request Header fields allow the client to pass additional information (metadata) about the request, and about the client itself, to the server.&lt;/p&gt;

&lt;p&gt;The format of an &lt;strong&gt;HTTP/1.x&lt;/strong&gt; header is straightforward: a case-insensitive name, a colon (&lt;code&gt;:&lt;/code&gt;), and then a value. The entire header field must fit on a single line.&lt;/p&gt;

&lt;p&gt;Example of Request Header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 49
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: A detailed explanation of HTTP headers and their various types will be covered in upcoming articles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Request body
&lt;/h3&gt;

&lt;p&gt;The Request Body (content) is the part of an HTTP request that carries data from the client to the server. Only &lt;code&gt;PATCH&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;, and &lt;code&gt;PUT&lt;/code&gt; requests have a body.&lt;br&gt;
The presence of a message body in a request is signaled by a &lt;code&gt;Content-Length&lt;/code&gt; or &lt;code&gt;Transfer-Encoding&lt;/code&gt; header field.&lt;/p&gt;
&lt;h2&gt;
  
  
  HTTP Response
&lt;/h2&gt;

&lt;p&gt;An HTTP response message has following four components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;Status-line&lt;/strong&gt;: &lt;code&gt;&amp;lt;HTTP-Version&amp;gt; &amp;lt;Status-Code&amp;gt; &amp;lt;Reason-Phrase&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Header&lt;/strong&gt; (General|Response|Entity) fields&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;empty line&lt;/strong&gt; indicating the end of the header fields&lt;/li&gt;
&lt;li&gt;Optionally a &lt;strong&gt;message-body&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Status line
&lt;/h3&gt;

&lt;p&gt;The first response line is the status-line, containing: &lt;strong&gt;protocol version&lt;/strong&gt;, &lt;strong&gt;status code&lt;/strong&gt;, and an optional &lt;strong&gt;reason phrase&lt;/strong&gt;, each separated by spaces.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Detailed breakdown:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. HTTP Version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTP Version or Protocol Version in a HTTP Response tells the client which set of protocol rules the server follows.&lt;br&gt;
The "HTTP" in the HTTP-version is &lt;strong&gt;case-sensitive&lt;/strong&gt; and must be written in uppercase. HTTP uses a &lt;code&gt;major.minor&lt;/code&gt; numbering system, defined in &lt;a href="https://datatracker.ietf.org/doc/html/rfc9112#name-http-version" rel="noopener noreferrer"&gt;RFC 9112&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Status Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A status code is a three-digit number (from 100 to 599) that describes the result of an HTTP request. Only the first digit of a status code defines its class, while the last two digits have no categorization role.&lt;br&gt;
There are five possible class values:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Status Code&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1xx (Informational)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;It means the request was received and the process is continuing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2xx (Success)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The request was successfully received, understood, and accepted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3xx (Redirection)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Further action needs to be taken in order to complete the request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4xx (Client Error)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The request contains bad syntax or cannot be fulfilled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5xx (Server Error)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The server failed to fulfill an apparently valid request&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;A list of all the status codes can be found in &lt;a href="https://datatracker.ietf.org/doc/html/rfc9110#name-status-codes" rel="noopener noreferrer"&gt;RFC 9110&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Reason phrase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Following the status code is an optional reason phrase, a human-readable description like &lt;code&gt;Created&lt;/code&gt;, which explains the outcome. Its optional nature is sometimes shown with parentheses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Response headers
&lt;/h3&gt;

&lt;p&gt;Response headers are metadata sent with a response. In HTTP/1.x, each is a case-insensitive string followed by a colon (&lt;code&gt;:&lt;/code&gt;) and a value, whose format is header-specific.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: A detailed explanation of HTTP headers and their various types will be covered in upcoming articles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Response body
&lt;/h3&gt;

&lt;p&gt;A response body is included in most messages. For successful &lt;code&gt;GET&lt;/code&gt; requests, it contains the requested resource. For errors, it typically provides a description of the error and indicates whether it is permanent or temporary.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>http</category>
      <category>beginners</category>
      <category>security</category>
    </item>
    <item>
      <title>How an HTTP Session Works</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Sun, 26 Oct 2025 17:51:25 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/how-an-http-session-works-4p6f</link>
      <guid>https://forem.com/iarchitsharma/how-an-http-session-works-4p6f</guid>
      <description>&lt;p&gt;In this article, we will discuss How an HTTP Session Works.&lt;br&gt;
HTTP consist of three phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Connection Phase&lt;/strong&gt; - The client initiates a &lt;strong&gt;TCP&lt;/strong&gt; connection (or another designated transport protocol) to the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request Phase&lt;/strong&gt; - The client sends an HTTP request and waits for the HTTP response from the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response Phase&lt;/strong&gt; - The server processes the request and sends an HTTP response to the client.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; For a comparison of how connections are handled in different HTTP versions, see my article on &lt;a href="https://dev.to/iarchitsharma/the-history-of-http-32ga"&gt;HTTP Version History&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The initial connection phase
&lt;/h2&gt;

&lt;p&gt;It is always the client which establishes the connection.&lt;br&gt;
From &lt;strong&gt;HTTP/1.0&lt;/strong&gt; through &lt;strong&gt;HTTP/2&lt;/strong&gt;, &lt;strong&gt;TCP&lt;/strong&gt; was used to initiate connections in the transport layer. This changed with &lt;strong&gt;HTTP/3&lt;/strong&gt;, which replaced TCP with &lt;strong&gt;QUIC&lt;/strong&gt; over &lt;strong&gt;UDP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;TCP uses default &lt;strong&gt;port 80&lt;/strong&gt; for an HTTP server on a computer. Underneath, TCP goes through a process known as the &lt;strong&gt;three-way handshake&lt;/strong&gt; to establish a connection. You can learn more about this process in &lt;a href="https://datatracker.ietf.org/doc/html/rfc793#section-3.4" rel="noopener noreferrer"&gt;RFC 793, Section 3.4&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Client HTTP Request
&lt;/h2&gt;

&lt;p&gt;Now &lt;strong&gt;user-agent&lt;/strong&gt; (typically a web browser, but can be anything else) can send the HTTP Request.&lt;br&gt;
HTTP request consists of &lt;strong&gt;text directives&lt;/strong&gt; (human-readable text commands), separated by &lt;strong&gt;CRLF&lt;/strong&gt; (special character sequence that means &lt;strong&gt;end of the line&lt;/strong&gt;) divided into three blocks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first line consists of a request method, followed by the path of the document, and the HTTP protocol version.&lt;/li&gt;
&lt;li&gt;The second line consists of &lt;strong&gt;HTTP Headers&lt;/strong&gt;, which are key-value pairs of text information that are sent with every HTTP request and response.&lt;/li&gt;
&lt;li&gt;Third block is an optional data block, which is mainly used by the POST method.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is an example of HTTP Request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET / HTTP/1.1
Host: example.com
Accept-Language: fr

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Request Methods:
&lt;/h3&gt;

&lt;p&gt;Request Methods indicate the purpose of the request and what is expected if the request is successful. These request methods are commonly referred to as HTTP verbs, though they can also be nouns. Most common methods are &lt;strong&gt;GET&lt;/strong&gt; and &lt;strong&gt;POST&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; We will explore HTTP methods in more detail in upcoming articles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Server HTTP Response
&lt;/h2&gt;

&lt;p&gt;The web server processes the HTTP request from the client and returns a response.&lt;br&gt;
Just like an HTTP request, an HTTP response also consists of text directives, separated by CRLF, and is divided into three blocks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first line, known as the status line, consists of an acknowledgment of the HTTP version used, followed by a response status code and a brief message.&lt;/li&gt;
&lt;li&gt;The second line contains HTTP headers, which give the client information about the data being sent. These headers form a block that ends with an empty line.&lt;/li&gt;
&lt;li&gt;The third line is a data block, which contains the optional data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example of HTTP Response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
Date: Mon, 27 Oct 2025 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Sat, 25 Oct 2025 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed

&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  HTTP status codes:
&lt;/h3&gt;

&lt;p&gt;HTTP status codes indicate whether a specific HTTP request has been successfully completed. Responses are categorized into five types:  &lt;em&gt;informational responses, successful responses, redirects, client errors, and server errors&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; We will explore HTTP status codes in more detail in upcoming articles.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>http</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>web</category>
    </item>
    <item>
      <title>The History of HTTP</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Sat, 25 Oct 2025 06:06:47 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/the-history-of-http-32ga</link>
      <guid>https://forem.com/iarchitsharma/the-history-of-http-32ga</guid>
      <description>&lt;p&gt;&lt;strong&gt;HTTP (HyperText Transfer Protocol)&lt;/strong&gt; is a protocol used for fetching resources such as HTML documents. Its primary function is to enable a conversation between a client (like a web browser) and a server (where a website is hosted).&lt;/p&gt;

&lt;p&gt;In this article, we will discuss how the World Wide Web was invented and how HTTP evolved from HTTP/0.9 to modern-day HTTP/3.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the World Wide Web Was Invented
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tim Berners-Lee&lt;/strong&gt; wrote a proposal to build a &lt;em&gt;hypertext system over the internet&lt;/em&gt; in 1989, while working at CERN.&lt;/p&gt;

&lt;p&gt;It had four fundamental pieces, all completed by the end of 1990:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HyperText Markup Language (HTML) - provide a textual format for hypertext documents.&lt;/li&gt;
&lt;li&gt;HyperText Transfer Protocol (HTTP) - protocol to exchange these documents.&lt;/li&gt;
&lt;li&gt;First Web Browser (WorldWideWeb) - a client to display these documents.&lt;/li&gt;
&lt;li&gt;Early version of httpd - a server to give access to the document.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On August 6, 1991, Tim Berners-Lee posted the first ever web page. This date is now considered the official start of the World Wide Web as a public project.&lt;br&gt;
You can still visit a restored version of it here: &lt;a href="http://info.cern.ch/hypertext/WWW/TheProject.html" rel="noopener noreferrer"&gt;http://info.cern.ch/hypertext/WWW/TheProject.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The HTTP protocol used in those early days was later named HTTP/0.9 and is sometimes called the one-line protocol.&lt;/p&gt;
&lt;h2&gt;
  
  
  HTTP/0.9
&lt;/h2&gt;

&lt;p&gt;The first version of HTTP had no version number, but later it was called HTTP/0.9. It was a very simple protocol.&lt;br&gt;
The Request message consisted of a single line, which began with the method (only GET was available) followed by the path to the resource. This is why its also known as the one-line protocol.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /my-page.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Response message only consisted of the file itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
  An text-only web page
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There were no HTTP headers and no status or error codes.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP/1.0
&lt;/h2&gt;

&lt;p&gt;Despite its limitations, HTTP/0.9 was rapidly enhanced by browsers and servers.&lt;br&gt;
HTTP/1.0 introduced numerous improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The version number, such as HTTP/1.0, was included directly in the request line.&lt;/li&gt;
&lt;li&gt;By introducing HTTP headers for both requests and responses, the protocol gained the ability to carry metadata, making it very flexible and extensible.&lt;/li&gt;
&lt;li&gt;Support for non-HTML content (like images, PDFs etc.) was made possible through the implementation of the &lt;code&gt;Content-Type&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;A status code line was sent at the beginning of a response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical request and response looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /page.html HTTP/1.0
User-Agent: NCSA_Mosaic/2.0 (Windows 3.1)

HTTP/1.0 200 OK
Date: Tue, 15 Nov 1994 08:12:31 GMT
Server: CERN/3.0 libwww/2.17
Content-Type: text/html
&amp;lt;HTML&amp;gt;
Hello World
  &amp;lt;IMG SRC="/image.gif"&amp;gt;
&amp;lt;/HTML&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the early days of the web (1991-1995), there was no official rulebook for new features. Developers would invent a new feature and wait to see if other browser and server developers adopted it. If others started using it, it became a de facto standard. If not, it would be abandoned.&lt;br&gt;
To solve this issue, an informational document describing common practices was published in November 1996. This was known as &lt;a href="https://datatracker.ietf.org/doc/html/rfc1945" rel="noopener noreferrer"&gt;RFC 1945&lt;/a&gt; and defined HTTP/1.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP/1.1
&lt;/h2&gt;

&lt;p&gt;Just a few months after HTTP/1.0 (RFC 1945), the first standardized version of HTTP, HTTP/1.1, was published in early 1997.&lt;br&gt;
HTTP/1.1 introduced major improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Persistent Connections&lt;/strong&gt; - a single TCP connection could be kept open and reused for multiple requests and responses, eliminating the significant overhead of repeatedly establishing connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipelining&lt;/strong&gt; - a browser could send several requests back-to-back without waiting for the first response to arrive, reducing the delay (latency) in communication.
(In practice, pipelining was difficult to implement correctly and was eventually superseded in HTTP/2).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional Cache Headers&lt;/strong&gt; - It introduced much more powerful headers for controlling caches (both browser caches and proxy caches).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chunked Responses&lt;/strong&gt; - The server could send the response in pieces, or "chunks." It would send a &lt;code&gt;Transfer-Encoding: chunked&lt;/code&gt; header and then stream the data in smaller parts, each with its own size indicator.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HOST Header&lt;/strong&gt; - introduced the ability to host different domains from the same IP address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Negotiation&lt;/strong&gt; - a client and a server could now agree on which content to exchange.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTP/1.1 was first published as &lt;a href="https://datatracker.ietf.org/doc/html/rfc2068" rel="noopener noreferrer"&gt;RFC 2068&lt;/a&gt; (The Proposed Standard) in January 1997.&lt;br&gt;
HTTP/1.1 protocol was refined over two revisions, &lt;a href="https://datatracker.ietf.org/doc/html/rfc2616" rel="noopener noreferrer"&gt;RFC 2616&lt;/a&gt; published in June 1999 and &lt;a href="https://datatracker.ietf.org/doc/html/rfc7230" rel="noopener noreferrer"&gt;RFC 7230&lt;/a&gt;-&lt;a href="https://datatracker.ietf.org/doc/html/rfc7235" rel="noopener noreferrer"&gt;RFC 7235&lt;/a&gt; published in June 2014 before the release of HTTP/2.&lt;br&gt;
The HTTP/1.1 standard (RFC 2616) remained stable for over 15 years.&lt;br&gt;
In 2022, HTTP/1.1 was updated again with &lt;a href="https://datatracker.ietf.org/doc/html/rfc9110" rel="noopener noreferrer"&gt;RFC 9110&lt;/a&gt; &amp;amp; &lt;a href="https://datatracker.ietf.org/doc/html/rfc9112" rel="noopener noreferrer"&gt;RFC 9112&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In 1994, Netscape created &lt;strong&gt;SSL&lt;/strong&gt; (later standardized as &lt;strong&gt;TLS&lt;/strong&gt;) to encrypt web traffic. This was initially for e-commerce security, but became essential for the entire web as it evolved from an academic network to a space where privacy and data protection were critical for all websites and applications.&lt;/p&gt;

&lt;p&gt;The web was originally meant to be editable. &lt;strong&gt;WebDAV (with CalDAV/CardDAV)&lt;/strong&gt; enabled this but required special server support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;REST&lt;/strong&gt; (2000) became more popular by using standard HTTP methods on specific URLs, allowing any website to create its own API without browser updates. The trade-off was that each REST API was custom, unlike WebDAV's standardization.&lt;/p&gt;

&lt;p&gt;HTTP and web security (&lt;strong&gt;same-origin policy&lt;/strong&gt;) were developed separately. Over time, new HTTP headers were created to safely lift some security restrictions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CORS&lt;/strong&gt; - Allows controlled cross-origin requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Security Policy (CSP)&lt;/strong&gt; - Prevents certain types of attacks&lt;/li&gt;
&lt;li&gt;Other headers like &lt;strong&gt;Do Not Track (DNT), X-Frame-Options&lt;/strong&gt;, etc., were added for specific security and privacy needs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTTP/2
&lt;/h2&gt;

&lt;p&gt;Over the years, websites started using more videos, images, and complex scripts to make pages interactive. Websites sent more data and made more requests, which overwhelmed &lt;strong&gt;HTTP/1.1&lt;/strong&gt; and made it inefficient.&lt;br&gt;
To address this issue, Google developed and deployed &lt;strong&gt;SPDY&lt;/strong&gt;, an experimental protocol, in the early 2010s. Developers widely adopted Google's SPDY protocol because it made websites faster and more efficient. Its success directly led to the creation of the official &lt;strong&gt;HTTP/2&lt;/strong&gt; standard.&lt;/p&gt;

&lt;p&gt;Here are the main ways HTTP/2 differs from HTTP/1.1:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Binary Protocol&lt;/strong&gt; - HTTP/2 used binary instead of plain text which is much harder for humans to read, but computers can process binary data much faster and more efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiplexing&lt;/strong&gt; - Parallel requests can be made over the same TCP connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Header Compression&lt;/strong&gt; - It uses a smart technique (HPACK) that eliminates sending duplicate header fields, drastically reducing the amount of data that needs to be sent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTP/2 standardized in May 2015 with &lt;a href="https://datatracker.ietf.org/doc/html/rfc7540" rel="noopener noreferrer"&gt;RFC 7540&lt;/a&gt; and &lt;a href="https://datatracker.ietf.org/doc/html/rfc7541" rel="noopener noreferrer"&gt;RFC 7541&lt;/a&gt;.&lt;br&gt;
HTTP/2 saw a rapid adoption because it didn't require changes to websites and applications. To use it, only an up-to-date server that communicated with a recent browser was necessary.&lt;/p&gt;

&lt;p&gt;HTTP's extensibility still drives new features, notably these 2016 extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alt-Svc (Alternative Service)&lt;/strong&gt; - enables smarter CDN caching because the browser can seamlessly switch to the faster location without changing the original resource's identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cookie Security Prefixes&lt;/strong&gt; - It guarantees that a "secure" cookie is truly secure from the moment it's created.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client Hints&lt;/strong&gt; -  allows your browser to proactively tell the server about its capabilities and constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTTP/3
&lt;/h2&gt;

&lt;p&gt;While &lt;strong&gt;HTTP/3&lt;/strong&gt; keeps the request/response semantics of HTTP/1.1 and HTTP/2, it uses &lt;strong&gt;QUIC&lt;/strong&gt; instead of &lt;strong&gt;TCP&lt;/strong&gt; for the underlying connection.&lt;br&gt;
As of October 2025, HTTP/3 is used by 35.9% of all the websites.&lt;/p&gt;

&lt;p&gt;Some major improvements of HTTP/3:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Eliminates Head-of-Line Blocking&lt;/strong&gt; - QUIC handles streams independently. If a packet is lost, only that specific stream is paused while others continue uninterrupted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster Connection Establishment&lt;/strong&gt; - QUIC builds encryption directly into the protocol, combining the TCP handshake and TLS encryption into a single step, significantly reducing initial connection latency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTP/3 standardized in June 2022 with &lt;a href="https://datatracker.ietf.org/doc/html/rfc9114" rel="noopener noreferrer"&gt;RFC 9114&lt;/a&gt;, &lt;a href="https://datatracker.ietf.org/doc/html/rfc9204" rel="noopener noreferrer"&gt;RFC 9204&lt;/a&gt; and &lt;a href="https://datatracker.ietf.org/doc/html/rfc9250" rel="noopener noreferrer"&gt;RFC 9250&lt;/a&gt;&lt;/p&gt;

</description>
      <category>http</category>
      <category>networking</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Styling the Lynx project</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Wed, 12 Mar 2025 08:04:18 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/styling-the-lynx-project-26d5</link>
      <guid>https://forem.com/iarchitsharma/styling-the-lynx-project-26d5</guid>
      <description>&lt;p&gt;In this article, we will dive into the world of styling in Lynx.&lt;br&gt;
Styling a Lynx app shares similarities with styling web apps, but it also introduces some key differences.&lt;/p&gt;
&lt;h2&gt;
  
  
  1) Lynx-Specific Properties (&lt;code&gt;-x-&lt;/code&gt; prefixed properties)
&lt;/h2&gt;

&lt;p&gt;Lynx introduces properties that start with &lt;code&gt;-x-&lt;/code&gt; to make it easier to style the design. These properties are specific to Lynx and are not part of standard CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;, The &lt;code&gt;-x-handle-color&lt;/code&gt; property is used specify the color of the floating marker when copying text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.text1&lt;/span&gt;&lt;span class="nd"&gt;::selection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;-x-handle-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refer to the official docs for all the &lt;a href="https://lynxjs.org/api/css/properties.html" rel="noopener noreferrer"&gt;styling properties&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2) Inline Styles and Selectors S
&lt;/h2&gt;

&lt;p&gt;In Lynx, inline styles are used in a way very similar to React's inline styling, where styles are passed as an object.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;view&lt;/span&gt;
      &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;
        &lt;span class="na"&gt;flexDirection:&lt;/span&gt; &lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="err"&gt;",&lt;/span&gt;
        &lt;span class="na"&gt;marginTop:&lt;/span&gt; &lt;span class="err"&gt;"50%",&lt;/span&gt;
        &lt;span class="na"&gt;transform:&lt;/span&gt; &lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="na"&gt;translate&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;-50&lt;/span&gt;&lt;span class="err"&gt;%,&lt;/span&gt; &lt;span class="na"&gt;-50&lt;/span&gt;&lt;span class="err"&gt;%)",&lt;/span&gt;
        &lt;span class="na"&gt;marginLeft:&lt;/span&gt; &lt;span class="err"&gt;"50%",&lt;/span&gt;
        &lt;span class="na"&gt;width:&lt;/span&gt; &lt;span class="err"&gt;"150&lt;/span&gt;&lt;span class="na"&gt;px&lt;/span&gt;&lt;span class="err"&gt;",&lt;/span&gt;
        &lt;span class="na"&gt;height:&lt;/span&gt; &lt;span class="err"&gt;"150&lt;/span&gt;&lt;span class="na"&gt;px&lt;/span&gt;&lt;span class="err"&gt;",&lt;/span&gt;
      &lt;span class="err"&gt;}}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/view&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3) Nesting Syntax:
&lt;/h2&gt;

&lt;p&gt;Native CSS does not support nesting but Lynx supports nesting syntax similar to &lt;strong&gt;Sass&lt;/strong&gt; or &lt;strong&gt;PostCSS&lt;/strong&gt;.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="err"&gt;&amp;amp;-b&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* equals */&lt;/span&gt;

&lt;span class="nc"&gt;.a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.a-b&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you know the basics, you can start exploring these APIs, which illustrate different Styling components in Lynx.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lynxjs.org/guide/styling/appearance.html" rel="noopener noreferrer"&gt;Styling API references&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lynxjs.org/api/css/properties.html" rel="noopener noreferrer"&gt;Property API references&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lynxjs.org/api/css/selectors.html" rel="noopener noreferrer"&gt;Selector API references&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we understand how to style the Lynx project, we'll explore the Layout in the next article.&lt;/p&gt;

&lt;p&gt;Follow for more!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Understanding Lynx Core Elements</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Sun, 09 Mar 2025 08:19:08 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/understanding-lynx-core-elements-2jod</link>
      <guid>https://forem.com/iarchitsharma/understanding-lynx-core-elements-2jod</guid>
      <description>&lt;p&gt;In this article, we will explore the core elements in Lynx. When we use React to create web user interfaces, we often utilize HTML tags such as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is an example React component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function example() {
    return (
        &amp;lt;div&amp;gt;
            &amp;lt;p&amp;gt;Hello World&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
    );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is important to note that the elements we write for the web are specific to the browser's understanding of HTML. When working with Lynx, these elements will not work because Lynx does not incorporate the concept of the DOM (Document Object Model).&lt;/p&gt;

&lt;h2&gt;
  
  
  Element tags
&lt;/h2&gt;

&lt;p&gt;Lynx uses &lt;strong&gt;element tags&lt;/strong&gt; that are similar to HTML elements. However, Lynx employs some unique element tags such as &lt;code&gt;&amp;lt;view&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;text&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;image&amp;gt;&lt;/code&gt; to display different types of content. Here is an example of how to display "Hello World" text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;text&amp;gt;Hello World&amp;lt;/text&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like HTML elements, Lynx element tags also support attributes. These attributes can be used by adding attribute names and values within the element tag.&lt;br&gt;
In this example, &lt;code&gt;style&lt;/code&gt; is the attribute name, and &lt;code&gt;background:green&lt;/code&gt; is the attribute value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;text style="background:green;"&amp;gt;Hello World&amp;lt;/text&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Learn more about attributes, refer to the &lt;a href="https://lynxjs.org/api/elements/built-in/view.html" rel="noopener noreferrer"&gt;API Reference&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built-in Elements
&lt;/h2&gt;

&lt;p&gt;The Lynx Engine includes built-in elements by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  View
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;view&lt;/code&gt; is fundamental building block for user interfaces in Android and iOS development.&lt;br&gt;
A &lt;code&gt;&amp;lt;view&amp;gt;&lt;/code&gt; is a small rectangular element on the screen that can display text, images, or user input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;view style="background:red;"&amp;gt;
  &amp;lt;text&amp;gt;Hello World!&amp;lt;/text&amp;gt;
&amp;lt;/view&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Image
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;image&amp;gt;&lt;/code&gt; element is used to display images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;image auto-size style="width:100px;" src="./assets/example.png" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out more built-in Lynx elements by referring to the &lt;a href="https://lynxjs.org/api/elements/built-in/view.html" rel="noopener noreferrer"&gt;Built-in Elements Documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Native Rendering of Elements
&lt;/h2&gt;

&lt;p&gt;At runtime, Lynx generates the corresponding &lt;strong&gt;iOS&lt;/strong&gt; and &lt;strong&gt;Android&lt;/strong&gt; component, or HTML elements on the Web.&lt;br&gt;
Here is a diagram from the official docs:&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%2Fwm5d3rzik3wl4c6eyqnf.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%2Fwm5d3rzik3wl4c6eyqnf.png" alt="Rendering of Elements in Lynx" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the documentation to &lt;a href="https://lynxjs.org/guide/ui/elements-components.html#behind-the-elements-native-rendering" rel="noopener noreferrer"&gt;learn more about native rendering&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the next article, we will learn about using CSS for styling Lynx pages.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow for updates!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>lynx</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Try out the new framework to build native applications!</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Fri, 07 Mar 2025 07:49:51 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/try-out-the-new-framework-to-build-native-applications-56pp</link>
      <guid>https://forem.com/iarchitsharma/try-out-the-new-framework-to-build-native-applications-56pp</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/iarchitsharma" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F676134%2F61430b7f-13be-4572-8ed5-4ba8f732386f.JPG" alt="iarchitsharma"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/iarchitsharma/create-lynx-project-eo7" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Create Lynx project&lt;/h2&gt;
      &lt;h3&gt;Archit Sharma ・ Mar 7&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#react&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#reactnative&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>react</category>
      <category>webdev</category>
      <category>reactnative</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create Lynx project</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Fri, 07 Mar 2025 07:48:44 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/create-lynx-project-eo7</link>
      <guid>https://forem.com/iarchitsharma/create-lynx-project-eo7</guid>
      <description>&lt;p&gt;In this article, let's create our very first &lt;strong&gt;Lynx project&lt;/strong&gt;. To begin, let's first set up our development environment.&lt;br&gt;
For Lynx, we need two things installed: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; (or any text editor of your choice)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we have our development environment ready, let's proceed.&lt;br&gt;
Open your command prompt in the location where you want to create your project directory and type the following prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create rspeedy@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fc6h2a8kj7y5049f0veyl.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%2Fc6h2a8kj7y5049f0veyl.png" alt="Lynx project using rspeedy" width="799" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Type a project name, or simply press Tab to use the default project name.&lt;/li&gt;
&lt;li&gt;Select a language: TypeScript or JavaScript. I will choose TypeScript, as it is recommended.&lt;/li&gt;
&lt;li&gt;Select additional tools. I will choose Biome, but you can select any.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This prompt will create a folder with your project name.&lt;/p&gt;

&lt;p&gt;Now, navigate to your project directory and install the NPM dependencies using package manager.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the Development Server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In &lt;strong&gt;Windows&lt;/strong&gt; Currently, you may get an error like the one below. This might be fixed in the future, but for now, let's manually fix it.&lt;/p&gt;
&lt;/blockquote&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%2Fek0fuo2lc8pr3avz85ds.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%2Fek0fuo2lc8pr3avz85ds.png" alt="Windows error in Lynx" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to fix this error:
&lt;/h3&gt;

&lt;p&gt;1) Install the following npm package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i @lynx-js/react-rsbuild-plugin-canary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) Go to &lt;code&gt;lynx.config.ts&lt;/code&gt; file and update this import from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin-canary'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now start the Development Server again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You might encounter another error now. To fix it, do the following:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Goto &lt;code&gt;node_modules/@lynx-js/tasm/index.js&lt;/code&gt; file and search for the &lt;code&gt;let encode = encode_napi;&lt;/code&gt; and replace it with &lt;code&gt;let encode = getEncodeMode();&lt;/code&gt;&lt;br&gt;
Now, run the development server again, and it should work.&lt;/p&gt;

&lt;p&gt;The next step is to install the Lynx Explorer app on your iOS or Android device to view the UI.&lt;/p&gt;

&lt;p&gt;Refer to the official documentation to learn how to install &lt;a href="https://lynxjs.org/guide/start/quick-start.html" rel="noopener noreferrer"&gt;Lynx Explorer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you installed Lynx Explorer app, you can scan the QR code using the App from the terminal and it will display the live UI on Lynx Explorer&lt;/p&gt;

&lt;p&gt;Now make a change and you will see the UI on your Lynx Explorer being updated automatically.&lt;/p&gt;

&lt;p&gt;Now that we understand how to generate a new Lynx project using Rspeedy, we'll explore the project's directory structure in the &lt;em&gt;next article&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow for more!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>reactnative</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The best static site generators in 2024🚀🔥</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Thu, 29 Aug 2024 09:09:05 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/the-best-static-site-generators-in-2024-dc7</link>
      <guid>https://forem.com/iarchitsharma/the-best-static-site-generators-in-2024-dc7</guid>
      <description>&lt;p&gt;We're all familiar with static site generators, so let's dive straight into the most loved ones of 2024. These generators have been tried, tested, and reviewed by the community, making them top choices for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Next.js
&lt;/h2&gt;

&lt;p&gt;Next.js is currently the leading framework for ReactJS development. It's far more than a simple static site generator; it provides robust features like server-side rendering, built-in API routes, and extensive customization options.&lt;/p&gt;

&lt;p&gt;It’s particularly suited for React-based projects that require a high level of flexibility and customization, supported by a large and active community along with a vast array of resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Nuxt.js
&lt;/h2&gt;

&lt;p&gt;Nuxt.js, built on top of Vue.js, is known for its intuitive syntax and user-friendly approach, making it an excellent choice for developers looking to quickly set up and build web applications. It offers a range of out-of-the-box features such as server-side rendering, static site generation, and routing, which significantly speed up the development process while reducing the need for extensive configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Astro
&lt;/h2&gt;

&lt;p&gt;Astro is a relatively new static site generator that has quickly gained popularity. It comes fully equipped with everything needed to build content-driven websites, including blogs, personal portfolios, marketing sites, e-commerce platforms, and more. Astro stands out for its strengths in static site generation, component-based architecture, and user-friendly experience, making it an excellent choice for content-focused projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Hugo
&lt;/h2&gt;

&lt;p&gt;Hugo is a fast, lightweight, and flexible static site generator, ideal for content-centric websites with straightforward templates and minimal dynamic elements. However, being Go-based and more verbose, Hugo can have a steeper learning curve and may require more effort to adapt and master.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Eleventy
&lt;/h2&gt;

&lt;p&gt;Eleventy is an open-source static site generator built with JavaScript. Although relatively new, it has quickly gained popularity for its simplicity. Unlike typical JavaScript frameworks, Eleventy doesn’t include any unnecessary boilerplate code, providing a clean and lightweight approach. If you’re looking for a highly flexible and customizable solution with a strong emphasis on JavaScript, Eleventy is an excellent choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Gatsby
&lt;/h2&gt;

&lt;p&gt;Gatsby is an open-source ReactJS framework designed for creating fast and secure static sites using data from multiple platforms. Its standout feature is its unified data layer, which seamlessly integrates data from various sources and incorporates it into your site's markup. If your goal is to build highly efficient static websites with access to a vast plugin ecosystem, Gatsby is a great choice.&lt;/p&gt;

&lt;p&gt;If you found this article helpful, please consider following or sharing it so that others can benefit too!&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Top 10 Popular Terraform Interview Questions</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Fri, 12 Jul 2024 16:33:24 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/top-10-popular-terraform-interview-questions-4aeg</link>
      <guid>https://forem.com/iarchitsharma/top-10-popular-terraform-interview-questions-4aeg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Terraform&lt;/strong&gt;, developed by &lt;strong&gt;HashiCorp&lt;/strong&gt;, has rapidly become a go-to tool for infrastructure as code (IaC) in the world of cloud computing and DevOps.&lt;br&gt;
In this blog post, we'll explore some of the top Terraform questions you might encounter in an interview.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions List
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What are the key features of Terraform?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It can do complete orchestration and not just configuration management (like Ansible and Puppet).&lt;/li&gt;
&lt;li&gt;Works on HCL (HashiCorp configuration language), which is very easy to learn and understand.&lt;/li&gt;
&lt;li&gt;Has amazing support of almost all the popular cloud providers like AWS, Azure, GCP etc.&lt;/li&gt;
&lt;li&gt;Easily manages the configuration of an immutable (dynamic) infrastructure.&lt;/li&gt;
&lt;li&gt;Provide immutable infrastructure where configuration changes smoothly.&lt;/li&gt;
&lt;li&gt;Easily portable from one provider to another.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What are the most useful Terraform commands?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;terraform init&lt;/strong&gt; - initializes the current directory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform refresh&lt;/strong&gt; - refreshes the state file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform output&lt;/strong&gt; - views Terraform outputs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform apply&lt;/strong&gt; - applies the Terraform code and builds stuff&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform destroy&lt;/strong&gt; - destroys what has been built by Terraform&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform graph&lt;/strong&gt; - creates a DOT-formatted graph&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;terraform plan&lt;/strong&gt; - a dry run to see what Terraform will do&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is Terraform init?
&lt;/h3&gt;

&lt;p&gt;Terraform initialises the code with the command terraform init. This command is used to set up the working directory for Terraform configuration files.&lt;/p&gt;

&lt;p&gt;You can use the init command for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing Plugins&lt;/li&gt;
&lt;li&gt;Installation of a Child Module&lt;/li&gt;
&lt;li&gt;Initialization of the backend&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What do you understand by terraform backend?
&lt;/h3&gt;

&lt;p&gt;Terraform Backend is a configuration option in Terraform that allows you to store and manage the state of your infrastructure in a remote or local location. The backend is responsible for storing the state file and providing an interface for reading and writing state data. When you run Terraform, it checks the backend to see if there are any changes to the state file, and if there are, it applies those changes to your infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are modules in Terraform?
&lt;/h3&gt;

&lt;p&gt;Modules are repeatable blocks of Terraform code that we can test, version and reuse to reduce duplication. In a more traditional programming language like Java, for example, Terraform modules would equate to classes or methods&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Private Module Registry?
&lt;/h3&gt;

&lt;p&gt;It's a feature from Terraform Cloud that allows you to share Terraform modules across the organization. You can enforce rules or “sentinel policies” on the registry that specify how members of your organization can use the modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Store Sensitive Data in Terraform?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using Environment Variables&lt;/li&gt;
&lt;li&gt;Utilizing Terraform Variables&lt;/li&gt;
&lt;li&gt;Employing Secret Management Tools like HashiCorp Vault, Azure Key Vault, or AWS Secrets Manager.&lt;/li&gt;
&lt;li&gt;Using Encryption and Secure Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Explain State File Locking?
&lt;/h3&gt;

&lt;p&gt;State file locking is a Terraform mechanism in which operations on a specific state file are blocked to avoid conflicts between multiple users performing the same process. When one user releases the lock, then only the other one can operate on that state. This helps in preventing state file corruption. This is a backend operation.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>terraform</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Top 10 Popular Kubernetes Interview Questions</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Fri, 21 Jun 2024 10:05:24 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/top-10-popular-kubernetes-interview-questions-3kfd</link>
      <guid>https://forem.com/iarchitsharma/top-10-popular-kubernetes-interview-questions-3kfd</guid>
      <description>&lt;p&gt;Preparing for your Kubernetes interview is key to achieving a successful outcome, but understanding what kind of questions or topics are going to be asked is not easy.&lt;/p&gt;

&lt;p&gt;So to help you get ready for your upcoming Kubernetes interview, here are 10 technical interview questions about Kubernetes&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions List
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is the Difference b/w Docker and Kubernetes?
&lt;/h3&gt;

&lt;p&gt;Docker is a container platform where as Kubernetes is a container orchestration environment that offers capabilities like Auto Scaling, Auto Healing, Clustering and Enterprise level support like Load Balancing&lt;/p&gt;

&lt;h3&gt;
  
  
  What are the main components of Kubernetes architecture?
&lt;/h3&gt;

&lt;p&gt;On a broad level you can divide Kubernetes into two parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Control Plane (API SERVER, SCHEDULER, Controller Manager, ETCD, C-CM)&lt;/li&gt;
&lt;li&gt;Data Plane (Kubelet, Kube-Proxy, Container Runtime)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What are the main differences between the Docker Swarm and Kubernetes?
&lt;/h3&gt;

&lt;p&gt;Kubernetes is better suited for large organization as it offers more scalability, networking capabilities like policies and huge third party ecosystem support&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the differences between the Docker container and a Kubernetes pod?
&lt;/h3&gt;

&lt;p&gt;A pod in Kubernetes is a runtime specification of a container in Docker. A pod provides more declarative way of defining using YAML and you can run more than one container in a pod.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a namespace in Kubernetes?
&lt;/h3&gt;

&lt;p&gt;Namespace is a logical isolation of resources, network policies, rbac and everything.&lt;br&gt;
For example, there are two projects using same k8s cluster. One project can use ns1 and other project can use ns2 without any overlap and authentication problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the role of Kube-proxy?
&lt;/h3&gt;

&lt;p&gt;Kube-proxy works by maintaining a set of network rules on each node in the cluster, which are updated dynamically as the services are added or removed. When a client sends a request to a service, the request is intercepted by kube-proxy on the node where it was received. Kube-proxy then looks up the destination endpoint for the service and routes the request accordingly.&lt;/p&gt;

&lt;p&gt;Kube-proxy is an essential component of Kubernetes as it ensures that services can communicate with each other.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are different types of services within Kubernetes?
&lt;/h3&gt;

&lt;p&gt;There are 3 different types of services user can create:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cluster IP mode&lt;/li&gt;
&lt;li&gt;Node Port mode&lt;/li&gt;
&lt;li&gt;Load Balancer mode&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What is the difference between NodePort and LoadBalencer type service?
&lt;/h3&gt;

&lt;p&gt;When a service is created a NodePort type, The kube-proxy updates the IP Tables with Node IP address and port that is chosen in the service configuration to access the pods.&lt;br&gt;
Where as if you create a Service as type LoadBalancer, the cloud control manager(C-CM) creates a external load balancer IP using the underlying cloud provider logic in the C-CM. Users can access services using the external IP.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the role of Kubelet?
&lt;/h3&gt;

&lt;p&gt;Kubelet manages the containers that are scheduled to run on that node. It ensures that the containers are running and healthy, and that the resources they need are available.&lt;br&gt;
Kubelet communicates with the Kubernetes API server to get information about the containers that should be running on the node, and then starts and stops the containers as needed to maintain the desired state. It also monitors the containers to ensure that they are running correctly, and restarts them if necessary.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are your Day to Day activities on Kubernetes?
&lt;/h3&gt;

&lt;p&gt;As part of our role as a DevOps engineer, We manage the Kubernetes cluster for our organization. We ensure that applications are deployed onto the Kubernetes cluster smoothly and that there are no issues with these applications. To achieve this, we have set up monitoring on our Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;Whenever there are bugs in the Kubernetes cluster, such as developers being unable to troubleshoot issues with pods or services, or routing traffic inside the cluster, we, as subject matter experts on Kubernetes, step in to resolve these problems.&lt;/p&gt;

&lt;p&gt;We also perform various maintenance activities, such as upgrading the version of worker nodes, installing default mandatory packages, and ensuring that these worker nodes are not exposed to security vulnerabilities. All of these are part of our day-to-day activities.&lt;/p&gt;

&lt;p&gt;Additionally, we serve as subject matter experts on Kubernetes within the organization. If anyone has an issue with Kubernetes, they create a Jira item for us to address.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Securing My First Internship with Open Source</title>
      <dc:creator>Archit Sharma</dc:creator>
      <pubDate>Tue, 28 May 2024 21:17:09 +0000</pubDate>
      <link>https://forem.com/iarchitsharma/securing-my-first-internship-with-open-source-15bn</link>
      <guid>https://forem.com/iarchitsharma/securing-my-first-internship-with-open-source-15bn</guid>
      <description>&lt;p&gt;Hey👋, I am &lt;a href="https://iarchitsharma.github.io/" rel="noopener noreferrer"&gt;Archit Sharma&lt;/a&gt;, a student and SDE based in India. In this blog, I aim to share my experience and journey of obtaining my first internship through open source contributions.&lt;/p&gt;

&lt;h2&gt;
  
  
  How did it all begin?
&lt;/h2&gt;

&lt;p&gt;It all started back in 2023 when I was confused about what I was doing. I was learning different tech stacks but wasn't applying them anywhere. One night, I was looking through the LFX mentorship page and found a project called Meshery, which is under Layer5. Even though I didn't have all the required tech stacks, I still applied.&lt;/p&gt;

&lt;p&gt;A few days later, I received a DM from the founder of Layer5, asking me to participate in the community and projects. He also gave me a brief introduction to the community and its projects.&lt;/p&gt;

&lt;p&gt;And that is how I kickstarted my journey in open source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Joining the Community
&lt;/h2&gt;

&lt;p&gt;I joined the Layer5 Slack and introduced myself in the &lt;code&gt;#newcomers&lt;/code&gt; channel, where I received advice to join the website meeting held every Monday. Taking that advice, I attended the website meeting. At first, I was a bit shy, but then I introduced myself during the meeting. Additionally, I received my very first issue to work on during the same meeting. It was a simple task—just adding an image to a React component.&lt;/p&gt;

&lt;p&gt;From that day onward, I never looked back and continued making contributions to the project. After six months of contributing, I was offered a six-month internship with Layer5.&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%2Flpr21twwm7xnecxfnxkg.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%2Flpr21twwm7xnecxfnxkg.png" alt="Layer5 Internship offer" width="800" height="637"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advice for New Open Source Contributors
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Consistency is key, be consistent in solving the project's problems&lt;/li&gt;
&lt;li&gt;Ask your questions, but don't overly rely on or disturb the maintainers, as they might end up solving the issue themselves.&lt;/li&gt;
&lt;li&gt;Things may seem overwhelming at first, but with patience, everything will eventually start to make sense.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Besides all of this, &lt;strong&gt;Layer5&lt;/strong&gt; is an awesome organization for networking and learning new things. In my opinion, it’s the most beginner-friendly organization, and I advise all open source beginners to give it a try.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something - your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life. - &lt;strong&gt;Steve Jobs&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
