Tag

net/http

1 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 24, 2024 · Backend Development

Using Function Types and Interfaces to Build Flexible HTTP Handlers in Go

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.

Backend DevelopmentGoHandler
0 likes · 9 min read
Using Function Types and Interfaces to Build Flexible HTTP Handlers in Go
Go Programming World
Go Programming World
Aug 22, 2024 · Backend Development

Graceful Shutdown in Go: Using os/signal and net/http for Clean Process Termination

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.

ConcurrencyGoGraceful Shutdown
0 likes · 44 min read
Graceful Shutdown in Go: Using os/signal and net/http for Clean Process Termination
Architecture Development Notes
Architecture Development Notes
Aug 7, 2024 · Backend Development

Why fasthttp Beats net/http by 10×: Deep Dive into Go’s High‑Performance HTTP Library

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.

GoMemory ManagementPerformance
0 likes · 5 min read
Why fasthttp Beats net/http by 10×: Deep Dive into Go’s High‑Performance HTTP Library
Go Programming World
Go Programming World
Jun 3, 2024 · Backend Development

Using GRequests: A Go Clone of Python Requests for Simplified HTTP Requests

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
Using GRequests: A Go Clone of Python Requests for Simplified HTTP Requests
IEG Growth Platform Technology Team
IEG Growth Platform Technology Team
Feb 21, 2022 · Backend Development

Deep Dive into Go net/http and Gin Framework Source Code

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
Deep Dive into Go net/http and Gin Framework Source Code
Qunar Tech Salon
Qunar Tech Salon
Dec 21, 2016 · Backend Development

Understanding net/http.Client Redirect Behavior and Cookie Handling in Go

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.

CheckRedirectCookieJarGo
0 likes · 5 min read
Understanding net/http.Client Redirect Behavior and Cookie Handling in Go