Expand description
Core model for Sendra: request/response types, YAML loading, HTTP execution.
This crate is deliberately free of CLI concerns (argument parsing, terminal
colouring, exit codes). A future sendra-tui crate will depend on it
directly, so everything here returns typed SendraError values that a
front-end can match on rather than pre-formatted strings.
Re-exports§
pub use assertions::AssertionKind;pub use assertions::AssertionReport;pub use assertions::AssertionResult;pub use assertions::Assertions;pub use assertions::NotAssertions;pub use capture::CaptureFailure;pub use capture::CaptureReport;pub use capture::CaptureResult;pub use capture::CaptureSource;pub use capture::Captures;pub use collection::Collection;pub use collection::Document;pub use config::Config;pub use environment::Environment;pub use http::client::build_client;pub use http::client::HttpClient;pub use http::response::RedirectHop;pub use http::response::Response;pub use http::send;pub use http::send_prepared;pub use oauth::generate_pkce;pub use oauth::generate_state;pub use oauth::OAuthTokenCache;pub use oauth::PkcePair;pub use request::auth::ApiKeyAuth;pub use request::auth::ApiKeyLocation;pub use request::auth::Auth;pub use request::auth::BasicAuth;pub use request::auth::OAuthAuth;pub use request::auth::OAuthGrantType;pub use request::multipart::MultipartPart;pub use request::Method;pub use request::Request;pub use request::RetryConfig;pub use script::Hook;pub use script::Script;pub use script::ScriptOutcome;pub use script::ScriptOutput;pub use script::Scripts;
Modules§
- assertions
- Declarative checks a request makes against the response it gets back.
- capture
- Values a request pulls out of its response and hands to the requests after it.
- collection
CollectionandDocument: a named group of requests in one YAML file, and the two shapes a Sendra file can hold.- config
- Tool-wide configuration: where Sendra’s config files live, how a project config overrides a global one, and what the result does to a request.
- environment
- Environments: named files of variables, and the substitution pass that puts them into a request.
- http
- Sending a
crate::Requestover the wire:sendandsend_prepared, the client that carries them (client), and what comes back (response). - oauth
- OAuth token acquisition for
auth.oauth’s three supported grants —client_credentials,password, andauthorization_code— andOAuthTokenCache, the in-run, in-memory cache that lets many requests sharing oneoauth:config reuse one token instead of re-authenticating per request. - request
Request: the on-disk shape of one request, its parsing/validation, andMethod. The three “structured input becomes the final wire form” passes —Request::resolve_query,Request::resolve_body,Request::resolve_auth— live inresolve, each field’s own type lives inmultipart/auth, and the repeated-header (de)serializers live inheaders(private: onlyRequest’s own#[serde(...)]attributes need them).- script
- The
pre_requestandpost_requesthooks: compiling them, running them, and the closed surface a script can see.
Enums§
- Sendra
Error - Every way loading or sending a request can fail.