<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Http on random thoughts</title><link>https://riad.run/tags/http/</link><description>Recent content in Http on random thoughts</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 25 Jan 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://riad.run/tags/http/feed.xml" rel="self" type="application/rss+xml"/><item><title>Understanding HTTP/1.1: Redirects in Go (Part 3)</title><link>https://riad.run/posts/http11-redirects/</link><pubDate>Sat, 25 Jan 2025 00:00:00 +0000</pubDate><guid>https://riad.run/posts/http11-redirects/</guid><description>&lt;p&gt;When I first learned about HTTP redirects I was confused about them. Which one do I need? One good way to always start from is the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections" rel="external noopener"&gt;MDN Docs&lt;/a&gt; for any web standard related questions.&lt;/p&gt;&#10;&lt;p&gt;Read the docs and you don&amp;rsquo;t even need to read this at all. Bye. Or you can stay&amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;301&lt;/code&gt; is permanent redirect. So if you hit it once the browser will cache it and won&amp;rsquo;t bother to reach out to the server for subsequent requests. On the other hand &lt;code&gt;302&lt;/code&gt; won&amp;rsquo;t be cached and browser will hit our server every time user requests one of the urls. Same goes for &lt;code&gt;308&lt;/code&gt; and &lt;code&gt;307&lt;/code&gt;. But they&amp;rsquo;ll preserve the HTTP method. There&amp;rsquo;s a nice table for that in MDN Docs.&lt;/p&gt;</description></item><item><title>Understanding HTTP/1.1: Content-Type in Go (Part 2)</title><link>https://riad.run/posts/http11-content-type/</link><pubDate>Sat, 28 Dec 2024 00:00:00 +0000</pubDate><guid>https://riad.run/posts/http11-content-type/</guid><description>&lt;p&gt;Previously we&amp;rsquo;ve seen how to construct basic HTTP request and response with our simple TCP server. In this blog post we&amp;rsquo;ll go a bit deeper into the &lt;code&gt;Content-Type&lt;/code&gt; header and see Content-Type in action.&lt;/p&gt;&#10;&lt;p&gt;This is specifically HTTP thing. So when we&amp;rsquo;re sending data to an HTTP client we can specify what type of data we&amp;rsquo;re sending by using a header called &lt;code&gt;Content-Type&lt;/code&gt;. When the client is browser even if we don&amp;rsquo;t say the content type in header sometimes it&amp;rsquo;ll guess from the bytes sent to it. All these we&amp;rsquo;ll see in this blog post!&lt;/p&gt;</description></item><item><title>Understanding HTTP/1.1: TCP Server in Go (Part 1)</title><link>https://riad.run/posts/http11tcpserver/</link><pubDate>Thu, 12 Dec 2024 00:00:00 +0000</pubDate><guid>https://riad.run/posts/http11tcpserver/</guid><description>&lt;p&gt;The goal of this blog post is to spin up a TCP server and start sending requests to the server with various clients. That way we&amp;rsquo;ll see what type of data an HTTP client like &lt;code&gt;curl&lt;/code&gt; sends to the server. Out of all the versions of HTTP, we&amp;rsquo;ll focus on &lt;code&gt;HTTP 1.x&lt;/code&gt;. As it&amp;rsquo;s a text based protocol and we&amp;rsquo;ll be able to see what&amp;rsquo;s going on under the hood.&lt;/p&gt;</description></item></channel></rss>