pub struct Args {Show 37 fields
pub url: String,
pub endpoint: Option<String>,
pub token: Option<String>,
pub browser: BrowserArg,
pub browser_bin: Option<PathBuf>,
pub render: RenderArg,
pub tab: String,
pub takeover: bool,
pub profile: Option<String>,
pub wait: String,
pub headers: Vec<String>,
pub cookies: Vec<String>,
pub user_agent: Option<String>,
pub evaluate_after_wait: Vec<String>,
pub want: Vec<String>,
pub method: String,
pub data: Option<String>,
pub form: Vec<String>,
pub network_bodies: NetworkBodiesArg,
pub network_body_max_bytes: u64,
pub readiness_idle_ms: u64,
pub readiness_stable_ms: u64,
pub readiness_min_text_bytes: u64,
pub no_network_redact: bool,
pub out: Option<PathBuf>,
pub cookie_jar: Option<PathBuf>,
pub no_cookie_jar: bool,
pub observe_main_wait_ms: u64,
pub max_response_bytes: u64,
pub retry: u32,
pub backoff_ms: u64,
pub proxy: Option<String>,
pub ca_cert: Option<PathBuf>,
pub tls_insecure: bool,
pub timeout_ms: u64,
pub capture_ws: bool,
pub capture_sse: bool,
}Fields§
§url: StringURL to fetch.
endpoint: Option<String>CDP endpoint of a running host.
Omit to spawn an inline ephemeral host for ordinary browser fetches;
with –takeover, omission discovers the standard local afhttp-host.
Falls back to AFHTTP_ENDPOINT_URL.
token: Option<String>Bearer token for a protected host.
Use when the host was started with --token-secret.
Falls back to AFHTTP_TOKEN_SECRET.
browser: BrowserArgBrowser backend for the inline host.
Ignored when –endpoint-url is set because the host owns its browser.
browser_bin: Option<PathBuf>Browser binary path for the inline host.
Use when auto-discovery cannot find one. Ignored when –endpoint-url is set.
render: RenderArgRender strategy: none, auto, or always.
none uses the HTTP fast path without a browser, auto starts with
HTTP and escalates on failure, and always uses the browser only.
tab: StringBrowser tab target: new or an existing CDP target ID.
new allocates a temporary target and closes it after fetch; an ID
reuses that target and leaves it open (the same ID accepted by
afhttp cdp, upload, and tabs).
takeover: boolEscalate captcha, login, or 2FA walls to human takeover.
Keeps a persistent tab open and returns its short-lived takeover URL in
next_action, plus a re-fetch command for the same tab once the human
clears the wall. Uses --endpoint-url / AFHTTP_ENDPOINT_URL when set;
otherwise discovers the standard local afhttp-host container (build
one with afhttp container install).
profile: Option<String>Host profile to use for this fetch.
Switches the host’s active profile if it differs (per-domain
isolation), relaunching its browser. With --takeover and no
--profile, the profile defaults to the URL’s registrable domain
(eTLD+1). Requires a host via --endpoint-url, or the standard local
takeover host discovered by --takeover.
wait: StringReadiness signal before browser capture.
Values: auto | load | idle | selector:
headers: Vec<String>Add a request header (repeatable).
Format: Name:value (a space after the colon is allowed).
Add a request cookie (repeatable). Format: name=value.
user_agent: Option<String>Override the User-Agent header for this fetch.
evaluate_after_wait: Vec<String>Evaluate JavaScript after readiness (repeatable).
Runs in page context before artifacts are captured.
want: Vec<String>Artifacts to capture, comma-separated.
Defaults to body on the HTTP fast path and browser-default artifacts
when rendering. content is the agent-oriented composed page view
(content.md); content_json is its structured form with link/action
candidates. storage is opt-in and sensitive (localStorage/IndexedDB).
method: StringHTTP method. Common values: POST, PUT, PATCH, DELETE.
data: Option<String>Request body as a string or @FILE.
Prefix with @ to read from a file path (for example,
--data @payload.json). Mutually exclusive with --form.
form: Vec<String>Add a URL-encoded form field (repeatable).
Sends application/x-www-form-urlencoded, uses name=value, and is
mutually exclusive with --data.
network_bodies: NetworkBodiesArgCapture network response bodies: off, xhr, or all.
xhr captures XHR/fetch only.
network_body_max_bytes: u64Per-body byte cap for captured network sub-requests.
See --max-response-bytes for the main HTTP-path response body.
readiness_idle_ms: u64Network quiet window used by –wait auto, in milliseconds.
readiness_stable_ms: u64DOM/text unchanged window used by –wait auto, in milliseconds.
readiness_min_text_bytes: u64Low visible-text byte threshold for –wait auto quality warnings only.
no_network_redact: boolDisable sensitive-value redaction in network.json.
Writes raw Authorization/Cookie headers and token-bearing query parameters to the artifact. Use only for trusted local debugging.
out: Option<PathBuf>Directory in which to write artifacts.
Defaults to afhttp-out under the system temporary directory. Files
persist there for inspection.
Override the profile cookie-jar path.
The default, derived from the host’s GET /profile, is
<profile-dir>/cookies.jar.json. A mismatch with the host profile is
rejected with invalid_argument; this flag is for tests and forensic
tooling, not production sessions. Honors AFHTTP_COOKIE_JAR when
omitted (same validation applies).
Disable cookie-jar replay and persistence for this fetch.
No cookies are replayed and no Set-Cookie responses are merged back.
observe_main_wait_ms: u64Maximum wait for the browser’s main-document event, in milliseconds.
Raise for slow networks or low-end machines.
max_response_bytes: u64Maximum main HTTP-path response body size in bytes.
See --network-body-max-bytes for captured sub-requests. The default is
1 GiB (1073741824); 0 disables the cap. Hitting the cap returns the
collected prefix successfully with a network_body_truncated warning.
retry: u32Number of retry attempts after the first.
Retries run only for retryable: true errors such as
host_unreachable or cdp_timeout; non-retryable failures such as
tls_error short-circuit. The default 0 means one total attempt.
backoff_ms: u64Fixed delay between retries, in milliseconds.
proxy: Option<String>Upstream proxy for this fetch’s HTTP fast path.
The SDK never honors ambient HTTP_PROXY; this flag is the only proxy
route. Use http://user:pass@host:port or socks5://host:port.
ca_cert: Option<PathBuf>PEM file with extra root CAs for the HTTP path.
Useful for self-signed staging or corporate MITM CAs.
tls_insecure: boolDisable TLS certificate verification on the HTTP path.
Dangerous: leaves the connection open to MITM. Use only against a known self-signed environment.
timeout_ms: u64Overall fetch timeout, in milliseconds. Applies to both the HTTP fast path and the browser path.
capture_ws: boolCapture WebSocket frame payloads.
Writes network-bodies/
capture_sse: boolCapture SSE event payloads.
Writes network-bodies/
Trait Implementations§
Source§impl Args for Args
impl Args for Args
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for Args
impl FromArgMatches for Args
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.