Search across all documentation pages
10 pages in this section.
Learn how Go's net/http package provides a complete HTTP/1.1 and HTTP/2 server and client for building APIs, proxies, and CLI tools.
Learn Go net/http basics with 9 code examples. Understand HandlerFunc, ServeMux, ListenAndServe, and build HTTP clients and servers.
Learn to build HTTP servers in Go, routing requests with net/http.ServeMux and handling patterns, including Go 1.22+ method-aware routes.
Configure http.Client and http.Transport in Go to manage timeouts, connection pooling, and prevent resource leaks in HTTP requests.
Learn to build and use middleware chains in Go's net/http to add cross-cutting logic and propagate request-scoped data safely.
Learn how to use Go's httptest package to test HTTP handlers. Test status codes, headers, and bodies with ResponseRecorder and NewServer.
Implement net/http best practices for Go services. Prevent route collisions, configure timeouts, limit POST bodies, and ensure graceful shutdowns.
A single-page roundup of every highlight bullet from the 9 pages in the net/http section, grouped by source page so you can scan all 47 takeaways without opening each article individually.