Documentation
¶
Overview ¶
Package curl implements the `curl` built-in.
This is NOT a real curl(1); it is a thin wrapper around the network.Doer plumbed through Context.Fetch. All HTTP/HTTPS traffic goes through that Doer — the curl built-in itself never touches the network stack. When Context.Fetch is nil (host did not configure BashOptions.Network or BashOptions.Fetch), curl emits the "network disabled" diagnostic and exits with code 2.
Supported flags:
-X METHOD request method -H 'K: V' extra header (repeatable) -d DATA request body (URL-encoded by default) --data-binary DATA request body verbatim --data-urlencode DATA request body, URL-encoded -F NAME=VALUE multipart/form-data field (repeatable) -o FILE write body to FILE (use - for stdout) -O write body to the URL's basename -s, --silent no progress / no error output -S, --show-error re-enable error output when used with -s -L, --location follow redirects (Doer policy decides) -i, --include include response headers in the output -I, --head issue a HEAD request, print headers only -k, --insecure permit TLS errors (no-op; Doer governs) -u USER:PASS HTTP Basic auth -A AGENT User-Agent header -e REFERER Referer header -f, --fail exit 22 on HTTP >= 400 without body output --max-time DUR per-request time cap (seconds, optional unit) -w FORMAT write-out format string (subset) -G issue a GET, append -d data as the query string --help show this help and exit
`-w` placeholders implemented: %{http_code}, %{size_download}, %{url_effective}, %{content_type}, %{response_code} (alias), %{num_headers}, and literal \n / \t escapes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.