Environment:1jehuang Jcode HTTP Client
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Networking |
| Last Updated | 2026-10-18 00:00 GMT |
Overview
reqwest HTTP client (v0.12) with rustls TLS, providing outbound HTTP for provider diagnostics, Jev Decisions API calls, and memory relevance scoring.
Description
The HTTP Client environment uses reqwest 0.12 configured with rustls-based TLS (no OpenSSL dependency) and native root certificates. It supports JSON serialization, HTTP/2, and system proxy configuration. This client is used for all outbound HTTP traffic including provider end-to-end diagnostics, Jev Typed Decisions API requests (bounded at 80 KiB), and memory relevance scoring batch requests.
Usage
Use this environment for run_provider_e2e (provider diagnostics that make real API calls), JevClient (Jev Decisions transport), and memory_jev_recall (batched relevance scoring). It is the mandatory HTTP transport for any code path that communicates with external APIs over HTTP.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Cross-platform | Linux, macOS, Windows |
| Hardware | Any | Network-bound, not CPU-bound |
| Network | Outbound HTTPS | TLS 1.2+ required by most providers |
Dependencies
Rust Packages
- `reqwest` = 0.12, features:
["json", "charset", "http2", "system-proxy", "rustls-tls", "rustls-tls-native-roots"] - `rustls` = 0.23, features:
["aws_lc_rs"] - `tokio-tungstenite` = 0.24 (WebSocket, features:
["connect", "rustls-tls-native-roots"])
Credentials
Provider API keys are passed at runtime (not stored in the HTTP client environment itself):
- `OPENAI_API_KEY` — OpenAI provider access
- `ANTHROPIC_API_KEY` — Anthropic/Claude provider access
- Other provider keys as configured via
jcode account login
Quick Install
# reqwest is pulled in automatically via Cargo.toml:
# reqwest = { version = "0.12", default-features = false,
# features = ["json", "charset", "http2", "system-proxy",
# "rustls-tls", "rustls-tls-native-roots"] }
cargo build --profile selfdev
Code Evidence
HTTP client dependency from Cargo.toml:147-149:
# HTTP client
reqwest = { version = "0.12", default-features = false, features = ["json", "charset", "http2", "system-proxy", "rustls-tls", "rustls-tls-native-roots"] }
rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs"] }
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-native-roots"] }
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `error sending request` | Network unreachable or proxy misconfigured | Check HTTPS_PROXY env var; system-proxy feature respects it
|
| `invalid certificate` | Missing native root certs | Install ca-certificates package (Linux)
|
| `Jev request exceeds the bounded context size` | Request body > 80 KiB | Reduce memory batch size or candidates count |
Compatibility Notes
- No OpenSSL dependency: Uses rustls with
aws_lc_rsprovider instead of OpenSSL, avoiding system library conflicts. - Linux compat (CentOS 7): The
linux-compat-vendored-opensslfeature bundles a compatible OpenSSL for the glibc 2.17 baseline. - System proxy: The
system-proxyfeature respectsHTTP_PROXY/HTTPS_PROXYenvironment variables.