Tagged articles
net/http
14 articles · Page 1 of 1

TonyBaiOct 20, 2026 · Backend Development
Go proposal #77441 adds Server.HandleRequest to net/http, exposing internal request-processing middleware (OPTIONS *, DefaultServeMux fallback, panic recovery) so HTTP/3 and other protocol implementations can reuse standard library behavior without code duplication, while also enabling full-server integration testing.
API DesignGoHTTP/3
0 likes · 18 min read

This guide explains Go's net/http ServeMux as a request router, demonstrates built‑in handlers like RedirectHandler, shows how to create custom http.Handler implementations, use functions as handlers, and pass variables via closures, complete with runnable code examples.
Custom HandlerGoHTTP handlers
0 likes · 8 min read

An in‑depth guide to Go’s net/http package explains its role as a standard‑library solution for HTTP client and server tasks, shows how to import it, demonstrates GET, POST and custom requests, builds simple servers with routing, adds middleware, and outlines common use cases such as APIs and web crawlers.
GoHTTP ClientHTTP server
0 likes · 10 min read

This article explains how Go's net/http package leverages function types combined with interfaces—particularly the Handler and HandlerFunc types—to create concise, flexible HTTP servers, reducing boilerplate, improving code reuse and testability, and demonstrates practical examples and underlying implementations.
Gobackend developmentfunction types
0 likes · 9 min read

This article explains how to implement graceful shutdown for Go programs, covering signal handling with os/signal, closing HTTP servers without interrupting active connections, managing goroutine lifecycles, and providing complete example code for both the standard net/http package and the Gin framework.
GoSignal Handlinggraceful shutdown
0 likes · 44 min read

This article examines why Go’s fasthttp library can outperform the standard net/http package by up to tenfold, covering memory allocation strategies, zero‑copy techniques, connection pooling, and additional optimizations, and offers guidance on when to choose each library for high‑performance backend services.
Gofasthttpnet/http
0 likes · 5 min read

This article walks through Go’s net/http package, explaining how http.HandleFunc registers handlers via DefaultServeMux, how ServeMux stores routes, performs exact and longest‑prefix matching, and how to extend the server with custom ServeMux and middleware for panic recovery and request timing.
DefaultServeMuxGoRouting
0 likes · 17 min read

This article introduces the Go library grequests—a clone of Python's requests—demonstrates its installation, compares its API with net/http, and provides concise examples for GET, POST, query strings, basic authentication, and file upload/download, highlighting its simplicity and advantages for HTTP client development.
APIFile UploadGo
0 likes · 10 min read

This article walks through creating a lightweight API gateway in Go using the standard net/http/httputil ReverseProxy, explains its core concepts, compares it with other gateway solutions, and provides a complete, runnable example that routes authentication and user services.
API GatewayGoReverseProxy
0 likes · 7 min read

This article compares Go’s standard net/http library with the high‑performance fasthttp server, detailing their request‑handling workflows, explaining fasthttp’s optimizations such as connection reuse, sync.Pool and unsafe.Pointer conversions, and walking through core code structures like workerPool, workerChan, and the Serve routine.
BackendGofasthttp
0 likes · 16 min read

This article provides a comprehensive analysis of Go's net/http library and the Gin framework, detailing request handling flow, router implementation, middleware chaining, and context management, while presenting key source code excerpts to illustrate how HTTP services are built and extended in Go.
ContextGinGo
0 likes · 18 min read

The article presents a detailed performance comparison of three HTTP client implementations—Java FunTester, Go's net/http, and the high‑performance fasthttp library—across multiple thread counts and artificial latency settings, reporting CPU usage, memory consumption, and QPS to determine the most efficient choice.
GoHTTPJava
0 likes · 9 min read

After mastering Go's net/http and fasthttp client libraries, this article presents six distinct server‑side implementations—ranging from basic net/http handlers to Echo, Gin, and fasthttprouter—highlighting their syntax, readability, and configuration differences for rapid backend development.
BackendECHOGin
0 likes · 7 min read

This article explains why a Go http.Client does not automatically carry cookies during redirects, how the default redirect logic works for different HTTP methods, and how to enable cookie storage with CookieJar or disable redirects using CheckRedirect.
CheckRedirectCookieCookieJar
0 likes · 5 min read
