Skip to main content

Crate rightkit_http

Crate rightkit_http 

Source
Expand description

rightkit-http: the shared blocking HTTP client for Right Suite apps.

  • Client: timeouts, bounded bodies, retry/backoff honoring Retry-After, retry-safety rules for non-idempotent methods, streaming responses.
  • sse: WHATWG-compliant Server-Sent Events decoding.
  • untrusted: tamper-evident wrapping of external text for model input.
  • secret: redacted Secret and the SecretStore interface that rightkit-secrets implements.
  • async_client (feature async): [AsyncClient], the same policy layer on reqwest/tokio, with a body [BodyStream] and an async [SseStream].
  • testing (feature): in-process mock server that records exact requests.

Re-exports§

pub use client::form_encode;
pub use client::percent_decode;
pub use client::percent_encode;
pub use client::Client;
pub use client::ClientConfig;
pub use client::Method;
pub use client::Request;
pub use client::Response;
pub use client::RetryEvent;
pub use client::StreamResponse;
pub use error::HttpError;
pub use retry::parse_retry_after;
pub use retry::RetryPolicy;
pub use secret::MemorySecretStore;
pub use secret::Secret;
pub use secret::SecretError;
pub use secret::SecretStore;
pub use sse::SseDecoder;
pub use sse::SseEvent;
pub use sse::SseReader;
pub use untrusted::wrap_untrusted_web_text;
pub use untrusted::wrap_untrusted_web_text_with;
pub use untrusted::WrapOptions;

Modules§

client
error
retry
secret
Secret handling shared by the net crates. rightkit-secrets (built in parallel) supplies the production SecretStore implementation (Keychain / Credential Manager); this crate only defines the interface so net crates do not depend on unfinished code.
sse
Server-Sent Events decoder (WHATWG EventSource framing): LF, CR and CRLF line endings, multi-line data, comments, id, retry, BOM, bounded line size.
untrusted
Untrusted web-text wrapping: external text reaches a model only inside a tamper-evident boundary that declares it data, never instructions. Ported from CodeRight browser_fetch::wrap_untrusted_web_text.