pub async fn execute_request(
spec: &CachedSpec,
matches: &ArgMatches,
base_url: Option<&str>,
dry_run: bool,
idempotency_key: Option<&str>,
global_config: Option<&GlobalConfig>,
output_format: &OutputFormat,
jq_filter: Option<&str>,
cache_config: Option<&CacheConfig>,
capture_output: bool,
retry_context: Option<&RetryContext>,
) -> Result<Option<String>, Error>Expand description
Executes HTTP requests based on parsed CLI arguments and cached spec data.
This module handles the mapping from CLI arguments back to API operations, resolves authentication secrets, builds HTTP requests, and validates responses.
§Arguments
spec- The cached specification containing operation detailsmatches- Parsed CLI arguments from clapbase_url- Optional base URL override. If None, usesBaseUrlResolverdry_run- If true, show request details without executingidempotency_key- Optional idempotency key for safe retriesglobal_config- Optional global configuration for URL resolutionoutput_format- Format for response output (json, yaml, table)jq_filter- Optional JQ filter expression to apply to responsecache_config- Optional cache configuration for response cachingcapture_output- If true, captures output and returns it instead of printing to stdoutretry_context- Optional retry configuration for automatic request retries
§Returns
Ok(Option<String>)- Request executed successfully. Returns Some(output) ifcapture_outputis trueErr(Error)- Request failed or validation error
§Errors
Returns errors for authentication failures, network issues, response validation, or JQ filter errors
§Panics
Panics if JSON serialization of dry-run information fails (extremely unlikely)