These examples are reference-oriented Cargo example targets for the root nano-get package.
They are ordered from the smallest helper-based usage to the most advanced client configuration.
-
simple-get- Demonstrates
nano_get::get - Run:
cargo run --example simple-get - Network: HTTP only
- Demonstrates
-
get-bytes- Demonstrates
nano_get::get_bytes - Run:
cargo run --example get-bytes - Network: HTTP only
- Demonstrates
-
head-request- Demonstrates
nano_get::headand response metadata access - Run:
cargo run --example head-request - Network: HTTP only
- Demonstrates
-
request-builder- Demonstrates
Request, custom headers, redirect policy, validators, and ranges - Run:
cargo run --example request-builder - Network: HTTP only
- Demonstrates
-
protocol-specific-helpers- Demonstrates HTTP-only and HTTPS-only helper APIs
- Run:
cargo run --example protocol-specific-helpers --features https - Network: HTTP + HTTPS
-
session-reuse-and-pipelining- Demonstrates
Client,Session, connection reuse, and pipelined GET requests - Run:
cargo run --example session-reuse-and-pipelining - Network: HTTP only
- Demonstrates
-
memory-cache- Demonstrates
CacheMode::Memoryand request cache directives - Run:
cargo run --example memory-cache - Network: HTTP only
- Demonstrates
-
basic-auth- Demonstrates built-in Basic auth helpers and request-level overrides
- Run:
cargo run --example basic-auth - Network: configurable protected endpoint via
NANO_GET_BASIC_AUTH_URL
-
custom-auth-handler- Demonstrates the generic
AuthHandlerinterface - Run:
cargo run --example custom-auth-handler - Network: configurable protected endpoint via
NANO_GET_CUSTOM_AUTH_URL
- Demonstrates the generic
-
proxy-and-proxy-auth
- Demonstrates
ProxyConfig, proxy headers, and proxy auth helpers - Run:
cargo run --example proxy-and-proxy-auth - Network: configurable proxy via
NANO_GET_PROXY_URL
advanced-client
- Demonstrates redirects, reuse, cache, optional proxy, and optional auth together
- Run:
cargo run --example advanced-client --features https - Network: HTTPS by default, optional proxy/auth env overrides
Some advanced examples rely on real endpoints to show the full behavior:
NANO_GET_BASIC_AUTH_URLNANO_GET_CUSTOM_AUTH_URLNANO_GET_PROXY_URLNANO_GET_PROXY_TARGET_URLNANO_GET_ADVANCED_URLNANO_GET_BASIC_AUTH_USERNANO_GET_BASIC_AUTH_PASSNANO_GET_PROXY_AUTH_USERNANO_GET_PROXY_AUTH_PASS
When those variables are missing, the auth/proxy-focused examples print setup guidance and exit successfully.