Use `State` to inject shared application state (DB pool, config, etc.) into every handler. `Path` and `Json` extractors deserialize URL params and request bodies for you.
Middleware in Go is `func(http.Handler) http.Handler`. Wrap a handler with logging, auth, recovery, CORS, or rate limiting — chain them together for a real middleware stack.
The standard library ships a production-quality HTTP server. `http.HandleFunc` registers a function; `http.ListenAndServe` blocks forever serving requests.
axum is the tokio-team's web framework — composable, type-safe handlers built on tower middleware. The hello-world is small enough to read in one screen.
Download a file in chunks so memory stays flat regardless of file size, with a tqdm progress bar showing speed + ETA. Skips re-download if the file is already complete.
A no-dependency HTTP GET helper with sensible defaults: short timeout, follow redirects, return body as string, throw on transport error. Pass extra headers as a simple associative array.
Parse the standard HTTP Link header (RFC 5988) into a relation → URL map. Lets you follow rel="next" pagination in APIs like GitHub without manually building URLs.
PHP's parse_str converts dots/spaces in keys to underscores. This alternative preserves them — important when parsing third-party query strings (e.g., webhook payloads).
`sendAsync` returns a `CompletableFuture<HttpResponse<T>>` — chain it like any other CF. Fan out N requests, wait for all with `CompletableFuture.allOf`.
`java.net.http.HttpClient` ships in the JDK — no Apache HttpClient or OkHttp needed for most cases. Reuse one client across the app; configure timeouts and follow-redirects up front.
On SIGINT/SIGTERM, stop accepting new connections but let in-flight requests finish. The `http.Server.Shutdown` method does exactly that — with a deadline.