Net/http package
The net/http package is Go’s standard-library package providing HTTP client and server implementations, requests, responses, and related functionality.
Learn Go with Pocket-Sized Projects
net/http is Go's standard-library package providing HTTP client and server implementations.
- How it is used
- Uses net/http to fetch exchange rates for a CLI and serve requests for a web service.
- How deep it goes
- Works through client timeouts, server startup, routing, handlers, status codes, and tests without detailing HTTP transport internals.
- Examples
- Uses an exchange-rate endpoint, a delayed test server, and a game-creation endpoint exercised with curl.
- What you can do after
- Build it from scratch: make a time-bounded HTTP call or serve and test a routed endpoint with net/http.
Read how Learn Go with Pocket-Sized Projects explains net/http package →
Go in Practice, Second Edition
net/http is Go's standard library package for HTTP clients and servers.
- How it is used
- Provides standard-library HTTP clients and servers, from simple requests and handlers to extensible web applications.
- How deep it goes
- Works through runnable GET and server examples, then describes request/client separation and configurable clients; server construction extends into routing and middleware.
- Examples
- Uses a localhost web server, a GET that reads a response body, a DELETE through the default client, and a timed custom client.
- What you can do after
- Build it from scratch as a small Go web server, and make GET or custom-client HTTP requests.
Read how Go in Practice, Second Edition explains net/http package →
Go by Example
The http package is Go's standard-library package providing HTTP client and server implementations and related types.
- How it is used
- Uses standard-library HTTP clients and servers to build responsive programs, services, request handlers, and tests.
- How deep it goes
- Explains client round trips and server handlers through APIs, execution flow, connection pooling, and response-writing order.
- Examples
- Uses concurrent request pipelines, NewRequest, NewRequestWithContext, Client.Do, status checks, handlers, and ResponseWriter.
- What you can do after
- Build it from scratch by sending HTTP requests, consuming responses, registering handlers, and serving clients.
Related concepts
- standard librarypart of · A standard library is a collection of reusable modules, types, functions, APIs, and other facilities distributed with a programming language implementation or platform.
- HTTPuses · HTTP is a standardized application-layer protocol that defines request-and-response messages for transferring resource representations between networked systems.
- net packageuses · The Go net package provides portable interfaces and implementations for network communication, including connections, listening, and address handling.
- clientproduces · A client is a person, organization, device, or software component that receives or uses a product, service, resource, or functionality provided by another entity.
- RESTused by · REST is an architectural style for distributed hypermedia systems that organizes interactions around resources and representations through constraints including a uniform interface, stateless communication, cacheability, and layered components.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


