Add examples/ with runnable usage demos for all major features
All checks were successful
CI / test (push) Successful in 31s
All checks were successful
CI / test (push) Successful in 31s
Six examples covering the full API surface: - basic-client: retry, timeout, logging, response size limit - form-request: form-encoded POST for OAuth/webhooks - load-balancing: weighted endpoints, circuit breaker, health checks - server-basic: routing, groups, JSON helpers, health, custom 404 - server-protected: CORS, rate limiting, body limits, timeouts - request-id-propagation: cross-service request ID forwarding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
13
README.md
13
README.md
@@ -195,6 +195,19 @@ client := httpx.New(
|
||||
)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
See the [`examples/`](examples/) directory for runnable programs:
|
||||
|
||||
| Example | Description |
|
||||
|---------|-------------|
|
||||
| [`basic-client`](examples/basic-client/) | HTTP client with retry, timeout, logging, and response size limit |
|
||||
| [`form-request`](examples/form-request/) | Form-encoded POST requests (OAuth, webhooks) |
|
||||
| [`load-balancing`](examples/load-balancing/) | Multi-endpoint client with weighted balancing, circuit breaker, and health checks |
|
||||
| [`server-basic`](examples/server-basic/) | Server with routing, groups, JSON helpers, health checks, and custom 404 |
|
||||
| [`server-protected`](examples/server-protected/) | Production server with CORS, rate limiting, body limits, and timeouts |
|
||||
| [`request-id-propagation`](examples/request-id-propagation/) | Request ID forwarding between server and client for distributed tracing |
|
||||
|
||||
## Requirements
|
||||
|
||||
Go 1.24+, stdlib only.
|
||||
|
||||
Reference in New Issue
Block a user