httpx: A Small, Fluent HTTP Client for Go That Stays Close to `net/http`

Go’s standard net/http package is excellent. It’s mature, reliable, performant, and provides almost everything you need to build HTTP clients. But there is one thing I’ve always found myself writing repeatedly: boilerplate. Creating requests, attaching headers, configuring authentication, handling response status codes, decoding JSON, closing response bodies, managing timeouts, and implementing retries — these are common tasks in almost every backend application. I wanted something that would make these operations simpler without introducing another heavy abstraction or a collection of third-party dependencies. ...

November 28, 2026 · 9 min · Saddam H

Query JSON data using Golang (gojsonq package)

Developers often need to consume JSON data from other services and query over it. However, querying JSON data can be time-consuming. Over the past few days, I’ve been working on a Golang package to make querying JSON data easier. The idea and inspiration for this package come from PHP-JSONQ by Nahid Bin Azhar. Let’s start by looking at a sample JSON dataset: Now that we have the JSON data, let’s dive into some examples of how to query it using the package. ...

May 29, 2018 · 2 min · Saddam H

Let’s make a simple todo app with Go

Generally, Go is perfect for building microservices, but that doesn’t mean building a simple MVC app is difficult. Go has built-in support for parsing HTML templates, although we won’t focus on that in this case. First, let’s write the Go code to serve an HTML page and save it in a directory. In this example, let’s create a directory called todoapp and inside it, create a home.tpl file. Paste the HTML content in home.tpl, which will make an HTTP call to our backend application. ...

November 23, 2017 · 5 min · Saddam H

An easy way to validate Go request

When building REST APIs or web applications in Go, one of the essential tasks is validating incoming request data. Having worked on various small to medium-sized projects in Golang—most of which are microservices providing RESTful APIs—I’ve employed several approaches to handle data validation. Among these, there’s one method I frequently rely on. For validating application/json or text/plain requests, I begin by defining a struct type to represent the specific request payload. Then, I implement a Validate method on that struct to encapsulate the validation logic. ...

October 18, 2017 · 2 min · Saddam H