<?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: Inam Ul Haq</title>
    <description>The latest articles on DEV Community by Inam Ul Haq (@inambe).</description>
    <link>https://dev.to/inambe</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%2F57241%2F4802c76f-057a-4845-ad1e-9700a84faaad.png</url>
      <title>DEV Community: Inam Ul Haq</title>
      <link>https://dev.to/inambe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/inambe"/>
    <language>en</language>
    <item>
      <title>How Emails Reach an Inbox</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Sun, 05 Dec 2021 17:44:13 +0000</pubDate>
      <link>https://dev.to/inambe/how-emails-reach-an-inbox-22j5</link>
      <guid>https://dev.to/inambe/how-emails-reach-an-inbox-22j5</guid>
      <description>&lt;p&gt;What happens when you send a message on let's say Twitter? Leaving Twitter's business logic, the answer is simple. The message gets stored in a database with the &lt;code&gt;id&lt;/code&gt;s of the sender and the receiver. Whenever needed, messages can be retrieved and displayed. It's easy, right? Well, emails are not!&lt;/p&gt;

&lt;p&gt;Let's now see how emails reach an inbox/mailbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bob sends an email to Sarah
&lt;/h2&gt;

&lt;p&gt;Let's say Bob uses Gmail and Sarah uses Yahoo. Bob writes an email for Sarah and hits the send button.&lt;/p&gt;

&lt;p&gt;Before going further, let me introduce two types of servers involved in this whole Email business; SMTP (Simple Mail Transfer Protocol) server and IMAP (Internet Message Access Protocol) server.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;POP, an alternative to IMAP, can also be used, but we will discuss that another day.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SMTP
&lt;/h3&gt;

&lt;p&gt;SMTP servers send and receive emails. For the most part, SMTP servers do what's called &lt;code&gt;relaying&lt;/code&gt;. After receiving and processing the email, the server tries to move (relay) the email to its destination. A destination can be another SMTP server or if the server itself is the destination, a directory/folder on the same server.&lt;/p&gt;

&lt;p&gt;An email may pass through several SMTP servers before reaching its destination.&lt;/p&gt;

&lt;h3&gt;
  
  
  IMAP
&lt;/h3&gt;

&lt;p&gt;IMAP is simple. It just retrieves the emails from where SMTP left them and makes them available to be used by Email Clients. You might remember configuring your Email Client like Thunderbird to use your mailbox provider's provided IMAP settings. Some Email Clients do it automatically though.&lt;/p&gt;

&lt;p&gt;When Bob and Sarah signed up for their respective mailbox providers (Gmail and Yahoo), both got accounts on their providers' SMTP and IMAP servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now coming back to Bob and Sarah&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After all the routing and DNS business, Bob's email reaches his SMTP server (Gmail). SMTP server processes the email and finds out its destination which is Yahoo's SMTP server. It then relays the email to Yahoo's SMTP server.&lt;/p&gt;

&lt;p&gt;Yahoo's SMTP server receives the email and determines that it itself is the destination server. The server then just move the email to Sarah's mailbox (directory/folder) which is on the same server.&lt;/p&gt;

&lt;p&gt;Sarah's mailbox has a new Email. Sarah's IMAP server makes the email available to be fetched by Email Clients. And Email Clients, checking up with the IMAP server after a specified interval, find out Sarah has a new email. Sarah gets a notification and now she can read it 🙌 &lt;/p&gt;

&lt;p&gt;Ask any question in the comments and I'll try to answer it!&lt;/p&gt;

&lt;p&gt;Follow me on twitter &lt;a href="https://twitter.com/MeInamUlHaq"&gt;@MeInamUlHaq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, checkout &lt;a href="https://email-okay.com"&gt;Free Email Verifier&lt;/a&gt; which I built.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>emails</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Why I like Tailwind CSS with React?</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Mon, 08 Feb 2021 14:17:38 +0000</pubDate>
      <link>https://dev.to/inambe/why-i-like-tailwind-css-with-react-1b1d</link>
      <guid>https://dev.to/inambe/why-i-like-tailwind-css-with-react-1b1d</guid>
      <description>&lt;p&gt;I've been using Tailwind CSS with React for some months now. I've used it on my website &lt;a href="http://inambe.dev/"&gt;inambe.dev&lt;/a&gt; and several of my clients' websites.&lt;/p&gt;

&lt;p&gt;Here in this post, I'll be laying out what I liked about using Tailwind CSS with React and why I still want to use it for my future projects.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post is mainly about Tailwind CSS not React.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;Tailwind is a utility-first CSS framework. What utility-first, in the case of Tailwind, means is that framework itself won't style any element but provide CSS utilities, in the form of CSS classes, for you to design UI yourself with consistency.&lt;/p&gt;

&lt;p&gt;Unlike Bootstrap, which provides pre-styled elements' classes (like &lt;code&gt;btn&lt;/code&gt; and &lt;code&gt;form-control&lt;/code&gt;) with limited configuration capability, Tailwind doesn't style any element and also provides a great configuration capability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Likes
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;I will not list the obvious likes of utility-first frameworks.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;Tailwind can very easily be configured to the extent that two websites would never look like that they're designed with the same framework. &lt;em&gt;If you've ever been on the internet; you know a bootstrap website when you see one&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;We can change or extend colors, fonts, spacing, breakpoints (for responsive design), and every other thing we have utilities for, without losing consistency. All in a single file. We can disable plugins we don't need or extend it with our own ones.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tailwind provides utilities through its plugin system.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Responsive design
&lt;/h3&gt;

&lt;p&gt;Responsive design is always the hardest job for me. Tailwind makes designing UI for different screen sizes a bliss! It has what is called a &lt;em&gt;mobile-first&lt;/em&gt; approach to build the UI.&lt;/p&gt;

&lt;p&gt;This one is the most important factor why I have and will use Tailwind.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;// make font size large on screen size '768px' and above
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"text-base md:text-lg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sane defaults
&lt;/h3&gt;

&lt;p&gt;Even though we can configure Tailwind in almost any way possible, it has very nice and sane defaults. Its defaults can cater most of the needs for my projects by default.&lt;/p&gt;

&lt;p&gt;For example, the spacing, I've never changed it for any of my projects because it works just as I need them to be even though I can change that.&lt;/p&gt;

&lt;p&gt;Most of the times, I just change fonts and colors in the configuration file and I'll be ready to start developing.&lt;/p&gt;

&lt;h3&gt;
  
  
  VSCode extension
&lt;/h3&gt;

&lt;p&gt;One of the most frustrating things that a utility-first framework can present is keeping track of the classes and remembering its names but this &lt;a href="https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss"&gt;VSCode extension&lt;/a&gt; has, for the most part, solved it for me.&lt;/p&gt;

&lt;p&gt;This extension provides many useful features like autocomplete, linting, and hover previews which can make developing with Tailwind a wonderful experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/16ws5xghsvsm/1VBiAqSSAQqQz4uNve5NGF/9fa07a57b06a6fc4e3aff255ae39d466/autocomplete.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/16ws5xghsvsm/1VBiAqSSAQqQz4uNve5NGF/9fa07a57b06a6fc4e3aff255ae39d466/autocomplete.png" alt="Tailwind CSS VSCode extension autocomplete"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Directives
&lt;/h3&gt;

&lt;p&gt;Directives are one of the most important features of Tailwind, which mostly helps with each project's needs without restricting anything. They can be used in many ways and for many purposes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@apply&lt;/code&gt; directive is the one that I've used the most so far. We can create our own utility classes composing utility classes provided by Tailwind using &lt;code&gt;@apply&lt;/code&gt; directive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.btn {
  @apply py-2 p-4 font-medium;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the build time, Tailwind will replace &lt;code&gt;@apply&lt;/code&gt; and its proceeding utility classes with their respective CSS styles. The above code in a CSS file would produce:&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;.btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500&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;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;One of the concerns we can have about a utility-first framework is that how it handles the unused utilities, which can greatly increase the size of CSS bundle.&lt;/p&gt;

&lt;p&gt;Luckily, Tailwind can purge (remove from output CSS bundle) unused utilities with just changing/adding couple of lines of configuration.&lt;/p&gt;

&lt;p&gt;For example, I've this configuration in one of project's Tailwind configuration file, which purges unused utilities from output CSS bundle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="nx"&gt;purge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./src/**/*.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&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;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tailwind with React has proven to be a very joyous experience for me to develop websites and apps with, due to reasons I've listed in the post.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>URL trailing slash — Gatsby</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Sun, 07 Feb 2021 07:35:35 +0000</pubDate>
      <link>https://dev.to/inambe/url-trailing-slash-gatsby-4njg</link>
      <guid>https://dev.to/inambe/url-trailing-slash-gatsby-4njg</guid>
      <description>&lt;p&gt;URL trailing slash can present some problems for Gatsby websites that probably can hurt your SEO. Find out these problems and their solution.&lt;/p&gt;

&lt;p&gt;Recently I was updating my website &lt;a href="https://inambe.dev"&gt;inambe.dev&lt;/a&gt; and building my blog, Belog. After doing most of the programming stuff, I relaxed a bit to do Google its job and well &lt;em&gt;rank my website on the first page of Google&lt;/em&gt; 😀.&lt;/p&gt;

&lt;p&gt;A few days later, I checked my Google Search Console to see how many pages Google has found and indexed from my website and the result was quite disappointing, to say the least. See for yourself:&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/16ws5xghsvsm/2XtpmQ0hekBiyamAR8pRzG/be632b0fc42db79eb91669196c3e2275/Screenshot_from_2021-02-06_19-43-22.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/16ws5xghsvsm/2XtpmQ0hekBiyamAR8pRzG/be632b0fc42db79eb91669196c3e2275/Screenshot_from_2021-02-06_19-43-22.png" alt="Google Search Console"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19 (NINETEEN)!&lt;/strong&gt; pages were excluded from indexing. Now, that's not necessarily wrong because it serves a purpose. There are times when you do not want a page to be indexed. But, that's never my intention for any page. So how this happened?&lt;/p&gt;

&lt;h2&gt;
  
  
  Trailing slash
&lt;/h2&gt;

&lt;p&gt;Trailing slash is a forward slash &lt;code&gt;/&lt;/code&gt; at the end of a URL. People have a difference of opinion whether it's good or bad. But I really never ever gave it a thought, I just used the choices that Netlify and Gatsby has by default. Now there were some problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem#1
&lt;/h2&gt;

&lt;p&gt;Netlify &lt;del&gt;redirects&lt;/del&gt; redirected all the URLs without trailing slash to the same URL with the trailing slash. So, for example, &lt;code&gt;/contact&lt;/code&gt; would be redirected to &lt;code&gt;/contact/&lt;/code&gt;. That's a problem because when Google Bot finds the &lt;code&gt;/contact&lt;/code&gt; link on my home page and proceeds to index it, Netlify &lt;del&gt;redirects&lt;/del&gt; redirected Google Bot to &lt;code&gt;/contact/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;6 of my pages were affected by this problem. You can see that in the screenshot I attached above. (the one titled &lt;strong&gt;Page with redirect&lt;/strong&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem#2
&lt;/h2&gt;

&lt;p&gt;I was using a &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/"&gt;Gatsby plugin&lt;/a&gt; to automatically generate the sitemap for my website. This plugin mentioned all the pages with trailing slashes in them. &lt;br&gt;
The problem with that was, Google Bot identified each page two times; one from links on my website, which were without trailing slashes, and one from sitemap, which had trailing slash.&lt;br&gt;
So Google Bot was like "yeah, I kinda found your pages, but they're not present in the sitemap, and also they redirect me 😔"&lt;/p&gt;
&lt;h2&gt;
  
  
  Problem#3
&lt;/h2&gt;

&lt;p&gt;The last one, bear with me, please. Since I was setting the canonical URL meta tag on each page, I was setting ... yes, you guessed it, without the trailing slash! which was returning a redirect HTTP response. Essentially canonical URLs weren't working, and Google Bot was having a rough time in the field on that day.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution 🎉
&lt;/h2&gt;

&lt;p&gt;The solution was simple, and I did not have a choice either (I'll tell you why). I had to embrace the trailing slash. I changed all the links on my website to add trailing slash in them.&lt;/p&gt;

&lt;p&gt;I also needed to add trailing slash on dynamically generated pages. I have this function in my code. Notice the trailing slash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getBlogURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`/blog/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why didn't I had a choice to remove the trailing slash all together?
&lt;/h3&gt;

&lt;p&gt;Because that's how Gatsby routing works. If you see a Gatsby build of a website, it has folders named after the slug of the pages and &lt;code&gt;index.html&lt;/code&gt; files in them, which loads automatically when we hit the slug on the website. It's just like, well, a regular static site, and that's exactly what Gatsby claims to be; a static site generator.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why didn't I notice it earlier?
&lt;/h2&gt;

&lt;p&gt;Because when we're surfing a Gatbsy website, it doesn't work as a regular static site. It works like &lt;a href="https://reactrouter.com"&gt;React Router&lt;/a&gt;, and we can easily forget how Google Bot would treat the website.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>gatsby</category>
      <category>netlify</category>
    </item>
    <item>
      <title>Computer Networking &amp; HTTP</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Sat, 13 Jun 2020 20:48:26 +0000</pubDate>
      <link>https://dev.to/inambe/computer-networking-http-1oii</link>
      <guid>https://dev.to/inambe/computer-networking-http-1oii</guid>
      <description>&lt;p&gt;&lt;strong&gt;Series: How WWW works?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WWW(World Wide Web) is so popular nowadays that apart from websites and web applications, even mobile apps and computer games won't work without it.&lt;/p&gt;

&lt;p&gt;HTTP(Hypertext Transfer Protocol) is the &lt;em&gt;main&lt;/em&gt; protocol behind WWW and some people even use the words HTTP and WWW interchangeably.&lt;/p&gt;

&lt;p&gt;I believe almost all web devs know about HTTP and WWW but some don't explore (or they're not taught) about another part of WWW which is computer networking. This is because computer networking is often considered as a Computer Science(academic) subject and self-taught web devs rarely need to know this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Computer Networking &amp;amp; HTTP
&lt;/h3&gt;

&lt;p&gt;HTTP only defines rules for communication between server and client(internet browser) but for communication we need to connect to other computers first. That's where computer networking protocols come in.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Internet browsers use computer networking protocols and HTTP to provide us the greatness and usefulness of WWW&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;TCP/IP&lt;/code&gt; and &lt;code&gt;UDP&lt;/code&gt; are two popular computer networking protocols used to connect computers, so they can communicate. Both of these protocols are implemented in most of the operating systems out there. All the &lt;strong&gt;DNS&lt;/strong&gt; and &lt;strong&gt;Socket&lt;/strong&gt; stuff happen in these protocols.&lt;/p&gt;

&lt;p&gt;HTTP clients leverage these computer networking protocols to connect to different HTTP servers (like Facebook's) and then talks to them in HTTP.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;TCP/IP&lt;/code&gt; is the most popular computer networking protocol for WWW, so I'll be using &lt;code&gt;TCP/IP&lt;/code&gt; to represent the computer networking protocol for rest of the post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BoY3UqIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3x0hmm0gvh6yaspy5iv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BoY3UqIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3x0hmm0gvh6yaspy5iv1.png" alt="TCP/IP Protocol with HTTP" width="880" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction to HTTP
&lt;/h3&gt;

&lt;p&gt;HTTP is a client-server architected protocol where the client and server can share information and ask each other to do a certain task(s) using agreed-upon language.&lt;/p&gt;

&lt;p&gt;HTTP defines words, manners, and rules for communication between client and server.&lt;/p&gt;

&lt;h4&gt;
  
  
  HTTP Request
&lt;/h4&gt;

&lt;p&gt;An HTTP request is simply a &lt;em&gt;text&lt;/em&gt; written using rules defined by HTTP. HTTP clients make a connection, often using &lt;code&gt;TCP/IP&lt;/code&gt;, to the server for sending the HTTP request. &lt;/p&gt;

&lt;p&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;GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.google.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see what HTTP request above tells the server(which it's being sent to).&lt;/p&gt;

&lt;p&gt;The first line of an HTTP request is a special line called request-line. In the example above it is saying that the request is a &lt;code&gt;GET&lt;/code&gt; request, to the &lt;code&gt;/&lt;/code&gt; document(web page address), using &lt;code&gt;1.1&lt;/code&gt; version of HTTP.&lt;/p&gt;

&lt;h4&gt;
  
  
  Headers
&lt;/h4&gt;

&lt;p&gt;All the lines after the request-line (until an empty line or end of the request) are HTTP Headers(Header for singular). Headers are written in colon-separated &lt;code&gt;key:value&lt;/code&gt; pairs. Headers are used to share information and/or instruct client or server to do a certain action(s). In the example above &lt;code&gt;Host&lt;/code&gt; header is used to tell the server that we're looking for &lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt; (a single server can have more than one host), and other headers for other kinds of information. &lt;/p&gt;

&lt;h4&gt;
  
  
  HTTP Response
&lt;/h4&gt;

&lt;p&gt;HTTP server responds to an HTTP request, interpreting it, with an HTTP response, which is sent to the client using the connection the server received the request from. HTTP response then will be interpreted by the HTTP client.&lt;/p&gt;

&lt;p&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
Content-Encoding: gzip
Accept-Ranges: bytes
Age: 322343
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Sat, 23 May 2020 05:20:54 GMT
Etag: "3147526947"
Expires: Sat, 30 May 2020 05:20:54 GMT
Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
Server: ECS (bsa/EB18)
Vary: Accept-Encoding
X-Cache: HIT
Content-Length: 648

&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
...
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;You may notice how the HTTP request and response examples are pretty similar; headers and first special line.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The first special line in an HTTP response is called the status-line. In the example above it is saying that the response is using &lt;code&gt;1.1&lt;/code&gt; version of HTTP and the HTTP status code is &lt;code&gt;200&lt;/code&gt; with the phrase &lt;code&gt;OK&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You may notice there is some content after headers and a line break; it's a response body(a request can have it too). HTTP request/response body is often interpreted as instructed in headers as in the example above, &lt;code&gt;Content-Type&lt;/code&gt; header tells the client that response type is &lt;code&gt;text/html; charset=UTF-8&lt;/code&gt; thus client will treat it as an HTML page.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;line break after headers indicates that headers have ended&lt;/em&gt;&lt;br&gt;
*&lt;em&gt;custom/non-standard headers are allowed in both request and response&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  HTTP Transaction Lifecycle
&lt;/h3&gt;

&lt;p&gt;backdrop: you use the internet browser to request &lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The browser uses &lt;code&gt;TCP/IP&lt;/code&gt; protocol, provided by the Operating System, to connect to &lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt; server&lt;/li&gt;
&lt;li&gt;The browser prepares and sends HTTP request to the server using connection made in the previous step&lt;/li&gt;
&lt;li&gt;The server receives HTTP request&lt;/li&gt;
&lt;li&gt;The server interprets HTTP request and responds with HTTP response&lt;/li&gt;
&lt;li&gt;The browser receives the HTTP response&lt;/li&gt;
&lt;li&gt;Browser interpret HTTP response (e.g. if it's HTML; render it)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;browser is an HTTP client&lt;/em&gt;&lt;br&gt;
*&lt;em&gt;server in the post means a web/HTTP server(there are other kinds of servers too)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;this post is the rewrite of my last post &lt;strong&gt;How HTTP works?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you didn't get any concept/term from the post, ask me in the comments section.&lt;br&gt;
You can follow me on &lt;a href="https://twitter.com/MeInamUlHuq"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>http</category>
      <category>www</category>
      <category>tcp</category>
    </item>
    <item>
      <title>How HTTP works?</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Sat, 23 May 2020 06:42:38 +0000</pubDate>
      <link>https://dev.to/inambe/how-http-works-2492</link>
      <guid>https://dev.to/inambe/how-http-works-2492</guid>
      <description>&lt;p&gt;&lt;code&gt;HTTP&lt;/code&gt; is a protocol used for WWW(World Wide Web) which serve us functional websites, web applications, and web APIs. &lt;code&gt;HTTP&lt;/code&gt; clients (internet browsers) use &lt;code&gt;TCP/IP&lt;/code&gt; or &lt;code&gt;UDP&lt;/code&gt; networking protocol with &lt;code&gt;HTTP&lt;/code&gt; to provide us the greatness and usefulness of WWW.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why we need &lt;code&gt;TCP/IP&lt;/code&gt; or &lt;code&gt;UDP&lt;/code&gt; with &lt;code&gt;HTTP&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;HTTP&lt;/code&gt; only defines rules for communication between server and client(internet browser) but for communication, we need to connect to other computer first.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;TCP/IP&lt;/code&gt; and &lt;code&gt;UDP&lt;/code&gt; are two popular networking protocols used to connect computers together, so they can communicate. Both of these networking protocols are implemented in most of the Operating Systems out there. All the DNS and sockets stuff happens in &lt;code&gt;TCP/IP&lt;/code&gt; and &lt;code&gt;UDP&lt;/code&gt; protocols not in &lt;code&gt;HTTP&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HTTP&lt;/code&gt; clients leverage these protocols to connect to different servers (like Facebook's) and then talks to them in &lt;code&gt;HTTP&lt;/code&gt;. &lt;code&gt;TCP/IP&lt;/code&gt; is most popular among others, so I'll be using that for rest of the post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3x0hmm0gvh6yaspy5iv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3x0hmm0gvh6yaspy5iv1.png" alt="TCP/IP Protocol with HTTP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction to HTTP
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;HTTP&lt;/code&gt; is a client-server architected protocol where client and server can ask each other to do specific tasks using agreed upon language(&lt;code&gt;HTTP&lt;/code&gt;). &lt;code&gt;HTTP&lt;/code&gt; defines words and manners for communication between client and server e.g. take a look at following &lt;code&gt;HTTP&lt;/code&gt; request:&lt;/p&gt;

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

GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.google.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive


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

&lt;/div&gt;

&lt;p&gt;This request is a &lt;code&gt;GET&lt;/code&gt; request, to the &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt; &lt;code&gt;Host&lt;/code&gt;, asking for the &lt;code&gt;/&lt;/code&gt; document (document is term used in HTTP for a web page), using &lt;code&gt;1.1&lt;/code&gt; version of &lt;code&gt;HTTP&lt;/code&gt;, along with other instructions/information for the server.&lt;/p&gt;

&lt;p&gt;Now server will respond with a &lt;code&gt;HTTP&lt;/code&gt; response, according to the request. Response then will be interpreted by the &lt;code&gt;HTTP&lt;/code&gt; client. Take a look at the following &lt;code&gt;HTTP&lt;/code&gt; response:&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-Encoding: gzip
Accept-Ranges: bytes
Age: 322343
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Sat, 23 May 2020 05:20:54 GMT
Etag: "3147526947"
Expires: Sat, 30 May 2020 05:20:54 GMT
Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
Server: ECS (bsa/EB18)
Vary: Accept-Encoding
X-Cache: HIT
Content-Length: 648

&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
...
&amp;lt;/html&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;You can notice there are two kinds of data in the &lt;code&gt;HTTP&lt;/code&gt; response; lines of colon separated key:value pairs and raw data; separated by a line break.&lt;/p&gt;

&lt;p&gt;Colon separated key:value pairs are called a &lt;code&gt;headers&lt;/code&gt;(&lt;code&gt;header&lt;/code&gt; for singular). Some standard headers are for instructions(like &lt;code&gt;Connection&lt;/code&gt;) and others are for information(like &lt;code&gt;User-Agent&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Raw data is called &lt;code&gt;body&lt;/code&gt; of the request or response. &lt;code&gt;body&lt;/code&gt; can contain any kind of raw data e.g. html, json, binary files, and form data.&lt;/p&gt;

&lt;p&gt;Both request and response can contain &lt;code&gt;HTTP&lt;/code&gt; defined standard and non-standard &lt;code&gt;headers&lt;/code&gt; and a &lt;code&gt;body&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Most of the time, servers and clients interpret &lt;code&gt;body&lt;/code&gt; as instructed in the &lt;code&gt;headers&lt;/code&gt;. For example, the response above has a &lt;code&gt;Content-Type: text/html; charset=UTF-8&lt;/code&gt; header which instructs &lt;code&gt;HTTP&lt;/code&gt; client to interpret &lt;code&gt;body&lt;/code&gt; of the response as HTML which results in a rendered HTML page.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;HTTP&lt;/code&gt; transaction lifecycle
&lt;/h3&gt;

&lt;p&gt;backdrop: you use internet browser to request &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Browser uses &lt;code&gt;TCP/IP&lt;/code&gt; protocol, provided by the Operating System, to connect to &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt; server&lt;/li&gt;
&lt;li&gt;Browser sends HTTP request to the server using connection made in previous step&lt;/li&gt;
&lt;li&gt;Server receives HTTP request&lt;/li&gt;
&lt;li&gt;Server interpret HTTP request and respond with HTTP response&lt;/li&gt;
&lt;li&gt;Browser receives HTTP response&lt;/li&gt;
&lt;li&gt;Browser interpret HTTP response (e.g. if it's HTML; render it)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;browser is an HTTP client&lt;/em&gt;&lt;br&gt;
&lt;em&gt;server in the post means a web/HTTP server(there are other kinds of servers too)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you didn't get any concept/term from the post, ask me in the comments section.&lt;/p&gt;

&lt;p&gt;You can follow me on &lt;a href="https://twitter.com/inambedev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Checkout GetResume, a &lt;a href="https://www.getresume.me" rel="noopener noreferrer"&gt;Free Resume Builder&lt;/a&gt;&lt;/p&gt;

</description>
      <category>http</category>
      <category>webdev</category>
      <category>server</category>
      <category>tcp</category>
    </item>
    <item>
      <title>What is __proto__? | JavaScript</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Fri, 07 Jun 2019 12:15:35 +0000</pubDate>
      <link>https://dev.to/inambe/what-is-proto-javascript-191m</link>
      <guid>https://dev.to/inambe/what-is-proto-javascript-191m</guid>
      <description>&lt;p&gt;You'd probably notice this &lt;code&gt;__proto__&lt;/code&gt; property every time you log an &lt;code&gt;object&lt;/code&gt; into the developer console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8qwwzv6jwrgi3mys4g2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8qwwzv6jwrgi3mys4g2b.png" alt="proto"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, I'm gonna try to explain where this &lt;code&gt;__proto__&lt;/code&gt; comes from, what it contains, and anything in between. So, let's get this &lt;code&gt;__proto__&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First, let's understand how a JavaScript &lt;code&gt;object&lt;/code&gt; gets constructed. Once you understand how an &lt;code&gt;object&lt;/code&gt; gets constructed, &lt;code&gt;__proto__&lt;/code&gt; property is gonna make a lot more sense than otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  How an &lt;code&gt;object&lt;/code&gt; get constructed?
&lt;/h2&gt;

&lt;p&gt;A JavaScript &lt;code&gt;object&lt;/code&gt;, always, get constructed/produced by a constructor function. Now, you'd probably say "But, object literals? They are not constructor functions."&lt;/p&gt;

&lt;p&gt;Well, object literals are just syntactic sugar. You can write objects without using object literals. See the example below, both syntax would produce the same output. The second approach gives us more power(which we won't discuss here) which object literal takes away from us.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// an object using object literal&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// an object using Object constructor function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&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 we know that every &lt;code&gt;object&lt;/code&gt;, in JavaScript, is constructed by a constructor function, let's get back to the original question.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;code&gt;__proto__&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;__proto__&lt;/code&gt; is a property, in every JavaScript &lt;code&gt;object&lt;/code&gt;, which points to &lt;code&gt;object&lt;/code&gt;'s constructor function's &lt;code&gt;prototype&lt;/code&gt; property. I know it's a bit hard to grasp, but let me simplify it for you.&lt;/p&gt;

&lt;p&gt;Every constructor function has this &lt;code&gt;prototype&lt;/code&gt; property on them. The picture below shows us &lt;code&gt;Object&lt;/code&gt; constructor function's &lt;code&gt;prototype&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkvmju7afrsqloq7fftoc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkvmju7afrsqloq7fftoc.png" alt="prototype"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, every &lt;code&gt;object&lt;/code&gt;, we'd construct/produce from &lt;code&gt;Object&lt;/code&gt; constructor function, would have &lt;code&gt;__proto__&lt;/code&gt; property pointing to &lt;code&gt;Object&lt;/code&gt; constructor function's &lt;code&gt;prototype&lt;/code&gt; property.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;When we use object literals, as we did in the example below, &lt;code&gt;Object&lt;/code&gt; constructor function is used to construct/produce the object. Now that we have a &lt;code&gt;person&lt;/code&gt; object constructed/produced from &lt;code&gt;Object&lt;/code&gt; constructor function, we can verify that &lt;code&gt;__proto__&lt;/code&gt; from our &lt;code&gt;person&lt;/code&gt; object is same as &lt;code&gt;prototype&lt;/code&gt; from &lt;code&gt;Object&lt;/code&gt; constructor function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// an object using object literal&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="c1"&gt;// verify&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__proto__&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you didn't understand something from the post, or I missed something, please, let me know.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is my first ever blog post and I'm open to criticism/suggestions.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to prevent misuse of a public REST API endpoint.</title>
      <dc:creator>Inam Ul Haq</dc:creator>
      <pubDate>Fri, 20 Jul 2018 20:45:31 +0000</pubDate>
      <link>https://dev.to/inambe/how-to-prevent-misuse-of-a-public-rest-api-endpoint-46cb</link>
      <guid>https://dev.to/inambe/how-to-prevent-misuse-of-a-public-rest-api-endpoint-46cb</guid>
      <description>&lt;p&gt;I have a REST API for CRUD operations on a database table, where inserting record does not require any authentication. The question is, how can I prevent that endpoint of my API from possible misuse, cause anyone can enter thousands of rows in a minute using a simple script.&lt;/p&gt;

&lt;p&gt;I'm using Slim-PHP and JWT.&lt;/p&gt;

&lt;p&gt;Thank You.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>php</category>
      <category>slim</category>
      <category>restapi</category>
    </item>
  </channel>
</rss>
