Expand description
§XDiff-NG: HTTP Request Comparison and Building Tools
XDiff-NG is a powerful command-line toolkit for HTTP request comparison and construction. It provides two main utilities:
- xdiff: A sophisticated diff tool for comparing HTTP requests and responses
- xreq: A flexible HTTP request builder based on predefined profiles
§Features
- Smart HTTP comparison with configurable skip rules
- Syntax highlighting for better readability
- YAML-based configuration with profile support
- High performance built with Rust
- Rich output formats and highlighting
- Extensible with custom profiles and configurations
§Example Usage
use xdiff_live::{DiffConfig, ExtraArgs};
// Load configuration from YAML file
let config = DiffConfig::load_yaml("config.yml").await?;
// Get a specific profile
let profile = config.get_profile("api_comparison").unwrap();
// Create extra arguments for parameter override
let extra_args = ExtraArgs::new_with_query(vec![
("param1".to_string(), "value1".to_string()),
]);
// Perform the comparison
let diff_result = profile.diff(extra_args).await?;
println!("{}", diff_result);Re-exports§
pub use config::get_body_text;pub use config::get_headers_text;pub use config::get_status_text;pub use config::is_default;pub use config::DiffConfig;pub use config::DiffProfile;pub use config::LoadConfig;pub use config::RequestConfig;pub use config::RequestProfile;pub use config::ResponseProfile;pub use config::ValidateConfig;
Modules§
- cli
- Command-line interface definitions for XDiff-NG tools.
- config
- Configuration management for XDiff-NG tools.
Structs§
- Extra
Args - Extra arguments for HTTP requests that can override or supplement the base configuration from profiles.
Functions§
- diff_
text - Generates a colored, side-by-side diff of two text strings.
- highlight_
text - Applies syntax highlighting to text based on the file extension and theme.
- process_
error_ output - Processes and formats error output for display to the user.