Transfer a URL.
Synopsis
curl [OPTIONS] <URL>
Description
Transfer data from or to a server using HTTP(S). In CLI mode, requests are routed through a server-side proxy to avoid CORS restrictions. In extension mode, requests go through the extension's background service worker. Runs in the just-bash WASM shell inside SLICC.
Options
-X, --request METHOD Specify request method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS).
-H, --header HEADER Pass custom header(s) to the server. Repeatable.
-d, --data DATA Send DATA in a POST request body.
-o, --output FILE Write output to FILE instead of stdout.
-O, --remote-name Write output to a file named as the remote file.
-s, --silent Silent mode.
-v, --verbose Be more verbose (show request/response headers).
-i, --include Include HTTP response headers in the output.
-I, --head Show headers only.
-L, --location Follow redirects.
-u, --user USER:PASS Server user and password.
-F, --form CONTENT Multipart POST data (key=value or key=@file).
--data-raw DATA Post raw data without @ interpretation.
-b, --cookie DATA Send cookies.
-w, --write-out FORMAT Display information after transfer (%{http_code}, %{time_total}, etc.).
-m, --max-time SECONDS Maximum time allowed for the transfer.
Examples
$ curl https://api.example.com/data
Perform a simple GET request.
$ curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com
POST JSON data.
$ curl -o output.html https://example.com
Download a page to a file.
$ curl -i -X HEAD https://example.com
Show only the response headers.
Notes
In CLI mode, all requests are proxied through the SLICC server (/api/fetch-proxy) to bypass browser CORS restrictions. In extension mode, requests are routed through the extension's service worker and use the extension's cookie jar. OAuth token substitution is supported via $(oauth-token provider) in headers and data. Binary downloads with -o or -O write to the VFS.
See Also
wget