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, if 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 (the host owns its browser).
browser_bin: Option<PathBuf>Browser binary path for the inline host, for when auto-discovery can’t find one. Ignored when –endpoint-url is set.
render: RenderArgRender strategy: none (HTTP fast path, no browser), auto (HTTP first, escalate to the browser on failure), or always (browser only).
tab: StringTab target: “new” allocates a temporary target and closes it after
fetch; a CDP target id reuses that target and leaves it open (the same
id afhttp cdp/upload/tabs accept).
takeover: boolEscalate to human takeover when a wall (captcha/login/2FA) is hit: keep
a persistent tab open and return 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 capture on the browser path:
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>JavaScript to evaluate after the wait condition resolves (repeatable). Runs in page context before artifacts are captured.
want: Vec<String>Artifacts to capture, comma-separated. Default: body on the HTTP fast
path; browser default artifacts when rendering is used. content is the
agent-oriented composed page view (content.md); content_json its
structured form with link/action candidates. storage is opt-in
(sensitive: localStorage/IndexedDB).
method: StringHTTP method. Common values: POST, PUT, PATCH, DELETE.
data: Option<String>Request body as a string. Prefix with @ to read from a file path
(e.g. --data @payload.json). Mutually exclusive with --form.
form: Vec<String>Add a form field (repeatable). Sends body as
application/x-www-form-urlencoded. Mutually exclusive with --data.
Format: name=value.
network_bodies: NetworkBodiesArgCapture response bodies for network requests: off, xhr (XHR/fetch only), or all.
network_body_max_bytes: u64Per-body cap for each captured network sub-request body, in bytes (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 redaction of sensitive values in network.json (redacted by default). Writes raw Authorization/Cookie headers and token-bearing query params to the artifact — only for trusted local debugging.
out: Option<PathBuf>Directory to write artifacts into. Defaults to afhttp-out under the
system temporary directory. Files persist there for inspection.
Override the cookie-jar path. The default — derived from the host’s
GET /profile — places the jar at <profile-dir>/cookies.jar.json.
This override is rejected with invalid_argument if it does not
match the host’s profile path; the flag exists for tests and
forensic tooling, not production sessions. Honors
AFHTTP_COOKIE_JAR when omitted (same validation applies).
Opt out of cookie-jar persistence for this fetch. No cookies are
replayed from the jar and no Set-Cookie responses are merged
back.
observe_main_wait_ms: u64Upper bound on the browser-path wait for the main document network event, in milliseconds. Raise for slow networks or low-end machines.
max_response_bytes: u64Upper bound on the main HTTP-path response body, in bytes (see
--network-body-max-bytes for captured network sub-request bodies).
Default 1 GiB (1073741824). 0 disables the cap entirely. When the
cap is hit, the fetch returns successfully with a
network_body_truncated warning and the prefix bytes that
were collected.
retry: u32Number of additional attempts after the first. Retries fire
only when the error has retryable: true (e.g.
host_unreachable, cdp_timeout); non-retryable failures
(tls_error, wait_selector_unmatched, etc.) short-circuit.
Default 0 = single attempt.
backoff_ms: u64Fixed delay between retries, in milliseconds.
proxy: Option<String>Per-fetch upstream HTTP/HTTPS proxy for the HTTP fast path.
The SDK never honors HTTP_PROXY from the environment; this
flag is the only way to route an HTTP-path fetch through one.
Format: http://user:pass@host:port or socks5://host:port.
ca_cert: Option<PathBuf>Path to a PEM file containing extra root CAs to trust for this fetch’s HTTP path. Useful for self-signed staging or corporate MITM CAs.
tls_insecure: boolDisable TLS certificate verification for this fetch’s HTTP path. Dangerous; leaves the connection open to MITM. Use only against known-self-signed environments.
timeout_ms: u64Overall fetch timeout, in milliseconds. Applies to both the HTTP fast path and the browser path.
capture_ws: boolCapture WebSocket frame payloads to network-bodies/
capture_sse: boolCapture SSE event payloads to 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.