109 lines
3.7 KiB
JSON
109 lines
3.7 KiB
JSON
{
|
|
"name": "curl",
|
|
"section": 1,
|
|
"title": "transfer a URL (Fetch-based client, not libcurl)",
|
|
"synopsis": [
|
|
"curl [options] URL...",
|
|
"curl uses Fetch in the booter (Node fetch or bare-fetch on bare-http1/bare-https), not libcurl."
|
|
],
|
|
"description": "HTTP/HTTPS client delegated from the booter. Subset of curl(1) flags; networking is WHATWG Fetch, not https://curl.se libcurl. See options and exitStatus for supported behavior; ../bare-os-booter/CLI_PARITY.md lists gaps vs full curl.",
|
|
"options": [
|
|
{
|
|
"flag": "-X, --request METHOD",
|
|
"meaning": "HTTP method"
|
|
},
|
|
{
|
|
"flag": "-H, --header LINE",
|
|
"meaning": "Request header (repeatable)"
|
|
},
|
|
{
|
|
"flag": "-A, --user-agent STRING",
|
|
"meaning": "Set User-Agent (default curl/VERSION-style string; last -A or -H User-Agent on the command line wins)"
|
|
},
|
|
{
|
|
"flag": "-d, --data / --data-* / --json",
|
|
"meaning": "Request body (POST by default when present)"
|
|
},
|
|
{
|
|
"flag": "-o, --output FILE",
|
|
"meaning": "Write response to VFS path; multiple URLs append .0, .1, …"
|
|
},
|
|
{
|
|
"flag": "-O, --remote-name",
|
|
"meaning": "Write each URL to a local name from the URL path (basename); cannot combine with -o"
|
|
},
|
|
{
|
|
"flag": "-T, --upload-file PATH",
|
|
"meaning": "PUT file body from VFS"
|
|
},
|
|
{
|
|
"flag": "-I, --head",
|
|
"meaning": "HEAD request; with -L, uses HEAD then GET after redirects (curl semantics; see bareOsNotes)"
|
|
},
|
|
{
|
|
"flag": "-i, --include",
|
|
"meaning": "Include response headers in output (non-HEAD)"
|
|
},
|
|
{
|
|
"flag": "-L, --location",
|
|
"meaning": "Follow redirects (GET/POST use fetch follow; -I -L uses manual hops)"
|
|
},
|
|
{
|
|
"flag": "-f, --fail",
|
|
"meaning": "Exit 22 on HTTP 4xx/5xx"
|
|
},
|
|
{
|
|
"flag": "-s, --silent",
|
|
"meaning": "No progress/error to stderr (unless -S)"
|
|
},
|
|
{
|
|
"flag": "-S, --show-error",
|
|
"meaning": "With -s, still show errors on stderr"
|
|
},
|
|
{
|
|
"flag": "-v, --verbose",
|
|
"meaning": "Trace request/response headers to stderr"
|
|
},
|
|
{
|
|
"flag": "-u, --user USER[:PASS]",
|
|
"meaning": "HTTP Basic Authorization"
|
|
},
|
|
{
|
|
"flag": "-m, --max-time SECONDS",
|
|
"meaning": "Abort whole request after SECONDS (AbortSignal); not a separate connect timeout"
|
|
},
|
|
{
|
|
"flag": "-w, --write-out FORMAT",
|
|
"meaning": "%{http_code}, %{url_effective}, %{size_download}, %{num_redirects} (num_redirects counts 3xx hops only for -I -L)"
|
|
},
|
|
{
|
|
"flag": "-V, --version / -h, --help",
|
|
"meaning": "Version string and short usage"
|
|
}
|
|
],
|
|
"keywords": ["curl", "http", "https", "fetch", "download"],
|
|
"bareOsNotes": "Not libcurl; implementation is packages/bare-os-booter/lib/curl-cli.js over global fetch (bare-fetch on Pear/Bare). Default User-Agent matches curl/VERSION form. Options and URLs may be interleaved. Host-style URLs without a scheme get http://; protocol-relative //host gets https://. Allowed URL schemes after normalization: http(s), data:, file://. For -I -L, HEAD is sent first; after a redirect, GET is used on the next URL (bare-fetch with redirect: follow keeps HEAD on every hop, so this path is manual). %{num_redirects} in -w reflects that manual redirect count only when -I and -L are both set.",
|
|
"exitStatus": [
|
|
"0 — success",
|
|
"1 — no fetch implementation",
|
|
"2 — bad usage or unknown option",
|
|
"7 — network or fetch failure",
|
|
"22 — HTTP error with -f",
|
|
"26 — cannot read upload file (-T)"
|
|
],
|
|
"seeAlso": [
|
|
{
|
|
"name": "git",
|
|
"section": 1
|
|
},
|
|
{
|
|
"name": "jq",
|
|
"section": 1
|
|
},
|
|
{
|
|
"name": "wget",
|
|
"section": 1
|
|
}
|
|
]
|
|
}
|