<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Glitch on Medium]]></title>
        <description><![CDATA[Stories by Glitch on Medium]]></description>
        <link>https://medium.com/@glitchyhitchy?source=rss-ec2d072e1e4c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_LRomwnrS34DxFJMmrkTHg.jpeg</url>
            <title>Stories by Glitch on Medium</title>
            <link>https://medium.com/@glitchyhitchy?source=rss-ec2d072e1e4c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:13:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@glitchyhitchy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Day 7 — Networking in Java: Handling Connectivity & Failures Gracefully]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-7-networking-in-java-handling-connectivity-failures-gracefully-e13bd70b0310?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*T3P-L_Hp-ukCuKpk0rfkcg.jpeg" width="1024"></a></p><p class="medium-feed-snippet">In the real world, even the cleanest code is useless if it can&#x2019;t talk to the outside world.
APIs fail, servers timeout, Wi-Fi drops, and&#x2026;</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-7-networking-in-java-handling-connectivity-failures-gracefully-e13bd70b0310?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-7-networking-in-java-handling-connectivity-failures-gracefully-e13bd70b0310?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e13bd70b0310</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[httpurlconnection]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 16:32:35 GMT</pubDate>
            <atom:updated>2025-10-09T16:32:35.837Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Day 6 — Building a Spring Boot REST API from Scratch]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-6-building-a-spring-boot-rest-api-from-scratch-0d61c443d74c?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*l6g8RKXPNlctojGWcb32WA.png" width="1024"></a></p><p class="medium-feed-snippet">Day 6 of the 30-Day Rebound Challenge&#x200A;&#x2014;&#x200A;today&#x2019;s focus: taking core Java logic and exposing it to the world through Spring Boot REST APIs&#x2026;</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-6-building-a-spring-boot-rest-api-from-scratch-0d61c443d74c?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-6-building-a-spring-boot-rest-api-from-scratch-0d61c443d74c?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d61c443d74c</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 16:48:39 GMT</pubDate>
            <atom:updated>2025-10-08T16:48:39.472Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Day 5— Mastering Java Streams & Lambda Expressions]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-5-mastering-java-streams-lambda-expressions-46ee1bbe7840?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*8CB80QNm0fatDzQqQZZ3og.png" width="1024"></a></p><p class="medium-feed-snippet">Day 5of my 30-Day Rebound Challenge&#x200A;&#x2014;&#x200A;code fluency requires transitioning from loops to declarative logic. Today I dove into Java Streams&#x2026;</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-5-mastering-java-streams-lambda-expressions-46ee1bbe7840?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-5-mastering-java-streams-lambda-expressions-46ee1bbe7840?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ee1bbe7840</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java-stream-api]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 16:48:22 GMT</pubDate>
            <atom:updated>2025-10-07T16:48:22.934Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Day 4 — Checked, Unchecked & Custom Exceptions in Java (BankAccount Simulation)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-4-checked-unchecked-custom-exceptions-in-java-bankaccount-simulation-d660317ec05f?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*YPzIsOAy5jlG5WXTITI2RA.png" width="1024"></a></p><p class="medium-feed-snippet">Today&#x2019;s snippet dives into Java&#x2019;s exception-handling mechanism&#x200A;&#x2014;&#x200A;one of those core topics that seem simple until you actually implement&#x2026;</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-4-checked-unchecked-custom-exceptions-in-java-bankaccount-simulation-d660317ec05f?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-4-checked-unchecked-custom-exceptions-in-java-bankaccount-simulation-d660317ec05f?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d660317ec05f</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[exception-handling]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 15:13:40 GMT</pubDate>
            <atom:updated>2025-10-06T15:13:40.079Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ Day 3 — Nested Maps & Sorting Logic]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-3-nested-maps-sorting-logic-81ace08466ce?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*U0ZnjjX6LxpMUV-N1iDczA.png" width="1024"></a></p><p class="medium-feed-snippet">Topic: Mastering HashMap inside HashMap with Sorting in Java</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-3-nested-maps-sorting-logic-81ace08466ce?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-3-nested-maps-sorting-logic-81ace08466ce?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/81ace08466ce</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[hashmap]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Sun, 05 Oct 2025 15:32:59 GMT</pubDate>
            <atom:updated>2025-10-05T15:32:59.782Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ Day 2 — Actual Coding: Learning Java Collections with AI Guidance ]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://glitchyhitchy.medium.com/day-2-actual-coding-learning-java-collections-with-ai-guidance-2e9ce8b253ce?source=rss-ec2d072e1e4c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*67DvVIM182e9OBT6GnLwPw.png" width="1024"></a></p><p class="medium-feed-snippet">Day 2 of my 30-Day Rebound Challenge&#x200A;&#x2014;&#x200A;this one wasn&#x2019;t about reading or watching tutorials. It was about typing every line, fixing every&#x2026;</p><p class="medium-feed-link"><a href="https://glitchyhitchy.medium.com/day-2-actual-coding-learning-java-collections-with-ai-guidance-2e9ce8b253ce?source=rss-ec2d072e1e4c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://glitchyhitchy.medium.com/day-2-actual-coding-learning-java-collections-with-ai-guidance-2e9ce8b253ce?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e9ce8b253ce</guid>
            <category><![CDATA[hashing]]></category>
            <category><![CDATA[collection]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Sat, 04 Oct 2025 18:58:25 GMT</pubDate>
            <atom:updated>2025-10-04T18:58:25.682Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Total Concentration Revision ️ — Sharpening Your Coding Before Interview Battles]]></title>
            <link>https://glitchyhitchy.medium.com/total-concentration-revision-%EF%B8%8F-sharpening-your-coding-before-interview-battles-6c2aaab61f6f?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c2aaab61f6f</guid>
            <category><![CDATA[coding-tips]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 11:55:13 GMT</pubDate>
            <atom:updated>2025-10-01T11:55:13.941Z</atom:updated>
            <content:encoded><![CDATA[<h3>Total Concentration Revision 🗡️ — Sharpening Your Coding Before Interview Battles</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouJ5BkjilsWuBUyC5GI7Rw.png" /></figure><p>This blog is my <strong>revision scroll</strong> 🗡️ — a space to revisit <strong>fundamental interview questions</strong> with quick-glance tables and practice snippets. Not to learn from zero, but to <strong>sharpen the coding blade I already carry</strong> before the next interview battle ⚔️.</p><p>⚔️ Core OOP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Byd8eE7ukx13RZsZYKCewQ.png" /></figure><pre>// Abstraction: Base Task blueprint<br>abstract class Task {<br>    String title;<br>    Task(String title) { this.title = title; }<br>    abstract void markDone();<br>}<br><br>// Class: Concrete ToDo task<br>class ToDo extends Task {<br>    private boolean done = false;   // Encapsulation<br><br>    ToDo(String title) { super(title); }<br><br>    // Polymorphism: implementing abstract method<br>    @Override<br>    void markDone() {<br>        done = true;<br>        System.out.println(title + &quot; ✅ completed!&quot;);<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        // Object: create a task<br>        Task t1 = new ToDo(&quot;Write Medium Blog&quot;);<br>        t1.markDone(); // Calls overridden method<br>    }<br>}</pre><p>⚔️ Methods &amp; Functions → <em>Simple Calculator</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkorYuwuB-NQtH1ZgiN4MA.png" /></figure><pre>class Calculator {<br>    // Overloading: same method name, diff params<br>    int add(int a, int b) { return a+b; }<br>    double add(double a, double b) { return a+b; }<br><br>    // Instance Method<br>    void greet() { System.out.println(&quot;Welcome to Calculator!&quot;); }<br><br>    // Static Method<br>    static void info() { System.out.println(&quot;Utility Class&quot;); }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        Calculator c = new Calculator();<br>        c.greet();<br>        System.out.println(c.add(5,3));     // 8<br>        System.out.println(c.add(2.5,4.5)); // 7.0<br>        Calculator.info();<br>    }<br>}</pre><p>⚔️ Collections → <em>Shopping Cart</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1R44C0yf-7KjDOsxuFlUVg.png" /></figure><pre>import java.util.*;<br><br>public class Cart {<br>    public static void main(String[] args) {<br>        List&lt;String&gt; cart = new ArrayList&lt;&gt;(); // List<br>        cart.add(&quot;Apple&quot;);<br>        cart.add(&quot;Orange&quot;);<br><br>        Set&lt;String&gt; uniqueItems = new HashSet&lt;&gt;(cart); // Set<br>        Map&lt;String,Integer&gt; itemQty = new HashMap&lt;&gt;(); // Map<br>        itemQty.put(&quot;Apple&quot;,2);<br>        itemQty.put(&quot;Orange&quot;,1);<br><br>        System.out.println(&quot;Cart: &quot; + cart);<br>        System.out.println(&quot;Unique Items: &quot; + uniqueItems);<br>        System.out.println(&quot;Quantities: &quot; + itemQty);<br>    }<br>}</pre><p>⚔️ Exceptions → <em>Login System</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZRonBrt3wal9sfj4fi2ag.png" /></figure><pre>class Login {<br>    void authenticate(String user, String pass) throws Exception {<br>        if(!&quot;admin&quot;.equals(user) || !&quot;1234&quot;.equals(pass)) {<br>            throw new Exception(&quot;Invalid Credentials ❌&quot;);<br>        }<br>        System.out.println(&quot;Login Successful ✅&quot;);<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        try {<br>            new Login().authenticate(&quot;admin&quot;,&quot;1234&quot;);<br>        } catch(Exception e) {<br>            System.out.println(&quot;Error: &quot; + e.getMessage());<br>        }<br>    }<br>}</pre><p>⚔️ Java Specifics + Modern Features → <em>Stream API Example</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Di5aa48sQ4wyUlKdBt6mLQ.png" /></figure><pre>import java.util.*;<br><br>public class StreamDemo {<br>    public static void main(String[] args) {<br>        List&lt;Integer&gt; nums = Arrays.asList(1,2,3,4,5,6,7,8,9);<br><br>        // Stream API: filter + map + collect<br>        List&lt;Integer&gt; evens = nums.stream()<br>                                  .filter(n -&gt; n % 2 == 0)   // filter<br>                                  .map(n -&gt; n * n)           // map<br>                                  .toList();                 // collect<br>        System.out.println(&quot;Squares of even numbers: &quot; + evens);<br>    }<br>}</pre><p>⚔️ Python Specifics → <em>Notes App</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNZ0K_JMXStPhmz9ijyDuw.png" /></figure><pre>class Note:<br>    def __init__(self, title, text):<br>        self.__title = title    # Encapsulation<br>        self.text = text<br><br>    def __str__(self):          # __str__ vs __repr__<br>        return f&quot;{self.__title}: {self.text}&quot;<br><br>notes = [Note(&quot;Idea&quot;, &quot;Start a side project&quot;), Note(&quot;Reminder&quot;, &quot;Buy milk&quot;)]<br>for n in notes:<br>    print(n)</pre><p>⚔️ Threads &amp; Concurrency → <em>Background Task</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKPgmyALJ3arA2VktnP3Sg.png" /></figure><pre>class Task extends Thread {<br>    public void run() {<br>        System.out.println(&quot;Background Task Running...&quot;);<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        Task t = new Task();<br>        t.start(); // Run in new thread<br>        System.out.println(&quot;Main continues...&quot;);<br>    }<br>}</pre><p>⚔️ Database → <em>Simple SQL Example</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCzOux-T8pB_2Nj5Rma-rg.png" /></figure><pre>-- Users Table<br>CREATE TABLE Users(<br>  id INT PRIMARY KEY,<br>  name VARCHAR(50),<br>  email VARCHAR(50) UNIQUE<br>);<br><br>-- Insert Data<br>INSERT INTO Users VALUES(1,&#39;Tanjiro&#39;,&#39;tanjiro@slayers.com&#39;);<br><br>-- Query<br>SELECT * FROM Users WHERE id=1;</pre><p>⚔️ Stream API (Java 8+) → <em>Filtering Tasks</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNVE3mtZIJG7B3IWtFiZLQ.png" /></figure><pre>import java.util.*;<br><br>public class StreamExample {<br>    public static void main(String[] args) {<br>        List&lt;String&gt; tasks = Arrays.asList(&quot;Blog&quot;, &quot;Code&quot;, &quot;Sleep&quot;, &quot;Code More&quot;);<br><br>        // Stream API: filter + map + collect<br>        List&lt;String&gt; codedTasks = tasks.stream()<br>                                       .filter(t -&gt; t.contains(&quot;Code&quot;)) // Intermediate op<br>                                       .map(String::toUpperCase)        // Transform<br>                                       .toList();                       // Terminal op<br><br>        System.out.println(&quot;Coded Tasks: &quot; + codedTasks);<br>    }<br>}</pre><p>⚔️ Full-Stack Basics → <em>Spring Boot REST API</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NB9tzVMcD4oW66sLunubA.png" /></figure><pre>// Simple REST API using Spring Boot<br>import org.springframework.web.bind.annotation.*;<br><br>@RestController<br>public class HelloController {<br>    <br>    @GetMapping(&quot;/hello&quot;)<br>    public String hello() {<br>        return &quot;Hello, Demon Slayers ⚔️&quot;;<br>    }<br>}</pre><ul><li>Run this in a Spring Boot project → access <a href="http://localhost:8080/hello">http://localhost:8080/hello</a></li><li>Output → &quot;Hello, Demon Slayers ⚔️&quot;</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c2aaab61f6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making POST Request in Go.]]></title>
            <link>https://glitchyhitchy.medium.com/making-post-request-in-go-7128bf70198a?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7128bf70198a</guid>
            <category><![CDATA[post-request]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[post]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 23:57:56 GMT</pubDate>
            <atom:updated>2023-03-27T23:57:56.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*hOOxqzeufumc5bRQqR5RnA.png" /></figure><p>In modern web development, it&#39;s essential to know how to make POST requests with JSON data. In this blog, we will discuss how to make a POST request with JSON data in Go.</p><p>Go is a statically typed language that offers great performance and has a simple syntax. Go has become a popular language for web development because it is fast, secure, and easy to use. Making HTTP requests with JSON data is a common task in web development, and Go makes it easy to do so.</p><p>To make a POST request with JSON data in Go, we need to use the &quot;net/http&quot; package. This package provides the &quot;http.Post&quot; function, which allows us to make POST requests to a server.</p><p>Here is an example of making a POST request with JSON data in Go:</p><p>go<br>Copy code<br>package main</p><p>import (<br> &quot;bytes&quot;<br> &quot;encoding/json&quot;<br> &quot;net/http&quot;<br>)</p><p>func main() {<br> // Create JSON data<br> data := map[string]string{&quot;username&quot;: &quot;johndoe&quot;, &quot;password&quot;: &quot;secret&quot;}<br> jsonData, err := json.Marshal(data)<br> if err != nil {<br> panic(err)<br> }</p><p>// Make POST request with JSON data<br> resp, err := http.Post(&quot;https://example.com/login&quot;, &quot;application/json&quot;, bytes.NewBuffer(jsonData))<br> if err != nil {<br> panic(err)<br> }<br> defer resp.Body.Close()</p><p>// Handle response<br> // ...<br>}<br>In this example, we first create a map of data that we want to send to the server. We then use the &quot;json.Marshal&quot; function to convert this data to JSON format.</p><p>We then use the &quot;http.Post&quot; function to make a POST request to the server. The first parameter is the URL of the server we want to send the request to. The second parameter is the content type of the request, which in this case is &quot;application/json&quot;. The third parameter is the data we want to send, which is a buffer containing the JSON data.</p><p>Finally, we handle the response from the server. In this example, we just close the response body, but in a real-world scenario, we would typically parse the response body to extract the data we need.</p><p>In conclusion, making a POST request with JSON data in Go is a straightforward process using the &quot;net/http&quot; package. By using the &quot;http.Post&quot; function and providing the URL, content type, and JSON data, we can easily make POST requests to a server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7128bf70198a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golang GET Request Tutorial]]></title>
            <link>https://glitchyhitchy.medium.com/golang-get-request-tutorial-69049f014e13?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/69049f014e13</guid>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[get-request]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 23:55:58 GMT</pubDate>
            <atom:updated>2023-03-27T23:55:58.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*MhKRXg1aoaBe1dtMnpM2Sw.png" /></figure><p>In today&#39;s world, making HTTP requests is a common task that is performed by most software engineers. Golang has gained immense popularity due to its simplicity, efficiency, and ease of use, making it a popular choice for building web applications. In this blog, we will discuss how to make a GET request in Golang.</p><p>Before we start, we need to install a few packages that will help us make HTTP requests. The net/http package provides the basic tools for making HTTP requests, while the fmt package helps us print the response on the console.</p><p>To install these packages, we can use the following command:</p><p>go get net/http<br>go get fmt<br>Once we have installed the packages, we can start making GET requests. In Golang, we can use the http.Get function to make a GET request. Here is a simple example:</p><p>package main</p><p>import (<br> &quot;fmt&quot;<br> &quot;net/http&quot;<br>)</p><p>func main() {<br> response, err := http.Get(&quot;https://jsonplaceholder.typicode.com/posts&quot;)<br> if err != nil {<br> fmt.Println(&quot;Error:&quot;, err)<br> return<br> }<br> defer response.Body.Close()</p><p>fmt.Println(&quot;Response status code:&quot;, response.StatusCode)<br>}<br>In the above example, we are making a GET request to the JSONPlaceholder API. The http.Get function returns two values: the HTTP response and an error object. We are using the defer keyword to ensure that the response body is closed after the function returns.</p><p>If there is an error in making the request, we print the error message on the console. Otherwise, we print the response status code. This code will print the HTTP status code of the response, which should be 200 OK.</p><p>We can also read the response body by using the ioutil.ReadAll function. Here&#39;s an example:</p><p>package main</p><p>import (<br> &quot;fmt&quot;<br> &quot;io/ioutil&quot;<br> &quot;net/http&quot;<br>)</p><p>func main() {<br> response, err := http.Get(&quot;https://jsonplaceholder.typicode.com/posts&quot;)<br> if err != nil {<br> fmt.Println(&quot;Error:&quot;, err)<br> return<br> }<br> defer response.Body.Close()</p><p>body, err := ioutil.ReadAll(response.Body)<br> if err != nil {<br> fmt.Println(&quot;Error:&quot;, err)<br> return<br> }</p><p>fmt.Println(&quot;Response body:&quot;, string(body))<br>}<br>In the above example, we are using the ioutil.ReadAll function to read the response body. We convert the byte slice to a string and print it on the console. This code will print the JSON response returned by the JSONPlaceholder API.</p><p>In conclusion, making GET requests in Golang is a straightforward task. We need to use the net/http package to make HTTP requests and the fmt package to print the response on the console. With the examples given above, you should be able to start making GET requests in your Golang projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69049f014e13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go File Handling Basics]]></title>
            <link>https://glitchyhitchy.medium.com/go-file-handling-basics-a23f008d8dbf?source=rss-ec2d072e1e4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a23f008d8dbf</guid>
            <category><![CDATA[file-handling]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <dc:creator><![CDATA[Glitch]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 23:51:50 GMT</pubDate>
            <atom:updated>2023-03-27T23:51:50.453Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*4y4MkBKkeaTKLckvHmlxAA.png" /></figure><p>Working with files is an essential part of any programming language, and Go makes it easy and efficient to work with files. In this blog post, we will discuss the basics of working with files in Go and explore some of the standard library functions that make file handling straightforward.</p><p>File handling in Go is done using the os package. The os package provides a set of functions for creating, opening, reading, writing, and closing files. Let&#39;s take a look at some of the commonly used functions:</p><h4>Creating a file</h4><p>To create a new file in Go, we can use the Create function from the os package. This function takes the name of the file as the first parameter and returns a file object and an error object. Here is an example:</p><p>file, err := os.Create(&quot;example.txt&quot;)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>defer file.Close()<br>The Create function creates a new file with the specified name in the current directory. In the example above, we create a file named &quot;example.txt&quot; and assign the returned file object to the file variable. We also use the defer statement to ensure that the file is closed after we are done using it.</p><h4>Opening a file</h4><p>To open an existing file in Go, we can use the Open function from the os package. This function takes the name of the file as the first parameter and returns a file object and an error object. Here is an example:</p><p>file, err := os.Open(&quot;example.txt&quot;)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>defer file.Close()<br>The Open function opens the file with the specified name in the current directory. In the example above, we open a file named &quot;example.txt&quot; and assign the returned file object to the file variable. We also use the defer statement to ensure that the file is closed after we are done using it.</p><h4>Writing to a file</h4><p>To write data to a file in Go, we can use the WriteString or Write function of the file object. Here is an example:</p><p>data := &quot;Hello, World!&quot;<br>file, err := os.Create(&quot;example.txt&quot;)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>defer file.Close()</p><p>_, err = file.WriteString(data)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>In the example above, we create a file named &quot;example.txt&quot;, write the string &quot;Hello, World!&quot; to it using the WriteString function, and then close the file using the defer statement.</p><h4>Reading from a file</h4><p>To read data from a file in Go, we can use the Read function of the file object. Here is an example:</p><p>file, err := os.Open(&quot;example.txt&quot;)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>defer file.Close()</p><p>data := make([]byte, 100)<br>count, err := file.Read(data)<br>if err != nil {<br> fmt.Println(err)<br> return<br>}<br>fmt.Printf(&quot;read %d bytes: %q\n&quot;, count, data[:count])<br>In the example above, we open a file named &quot;example.txt&quot;, read up to 100 bytes from the file using the Read function, and then print the number of bytes read and the read data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a23f008d8dbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>