curl

curl sends HTTP/HTTPS requests from the hosting account, shows status, headers and body, submits methods, data, cookies and Basic Auth, and can save or open the response in an editor.

NetworkVersion 1.2.5Stable
lil-terminal

Overview

Use curl when the important question is how a remote endpoint behaves from the server itself. It is useful for API checks, redirects, response headers, IPv4/IPv6 diagnostics and downloading a response without a system shell.

Request, response and execution point

curl runs on the hosting server, not in your local browser. Start with a simple GET or headers-only request, then add a body, authentication or diagnostic flags deliberately; -k intentionally disables certificate verification.

Syntax

lil-terminal
curl <url|host|me> [options]

Reference

curl me

use the current host

curl example.com

send a GET request and show status and body

curl example.com -I

show the final response headers only

curl example.com -s [file]

save the response; use the URL filename when omitted

curl example.com -X POST -d "a=1"

send a request body

-X <method>

set the HTTP method

-d <data>

set the request body; defaults to POST

-H "Name: value"

add a request header; may be repeated

-u <user>

use HTTP Basic authentication through a hidden password prompt

-c '{"name":"value"}'

send cookies from a JSON object

-s [file] | -o <file>

save the response on the host

-a

append instead of replacing; requires -s or -o

-i

include final response headers

-I

show final response headers only

-j

show status, URL, headers and body as structured JSON

-edit @edit

open the response body in the text editor through .lil.tmp

-code @code

open the response body in the code editor through .lil.tmp

-t [seconds]

use 5 seconds or a custom timeout from 1 to 300

-T

use a 300-second timeout

-4 | -6

use IPv4 or IPv6 when cURL is available

-k

allow an insecure TLS certificate

-r

do not follow redirects

Practical workflow

Start with curl example.com to read the response or curl example.com -I to view only response headers. Use -i for headers together with the body and -j for structured JSON. Add -X, -d and repeatable -H to send an API request. -s or -o saves the body to a file on the hosting account; -a appends rather than replaces. -edit and -code open a text response in an installed browser editor.

Limits and safety

Keep passwords out of command history: -u <user> prompts for a secret, while cookies and -d bodies typed into commands can remain visible. By default TLS certificates are checked and redirects are followed (up to five); -k removes TLS verification, while -r prevents redirects. Without the PHP cURL extension, PHP streams handle ordinary requests, but -4/-6 explicitly require cURL. Non-file responses are limited to 8 MiB; saves to 256 MiB. Only request addresses you are authorised to access, especially when the hosting account can reach internal services. Examples show educational snapshots, not live requests.

JSON and editor modes

-j always returns one predictable JSON object. If the body itself is valid JSON, the body field contains the parsed value; otherwise it contains text. -edit and -code write the response body to the protected core-root buffer .lil.tmp and immediately open it in the selected installed editor. The buffer is cleared by exit, kill and kill -cache.

Safety

TLS certificates and redirects are handled safely by default. Use -k or -r only deliberately. Editor modes are for textual responses only and cannot be combined with -s or -o.

Address-family fallback now fails clearly

curl -4/-6 reports when PHP cURL is unavailable, rather than silently using an unfiltered HTTP stream.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Inspect headers, then save a response

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install curl
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install curl -m
Exact public version

Install exactly this published version.

install curl -v 1.2.5
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade curl
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install curl -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Inspect headers, then save a response
curl https://example.com
Illustrative network snapshot — not a live request
HTTP:		200
URL:		https://example.com/

<!doctype html>
<html>…</html>
Use the current host
curl me
Illustrative network snapshot — not a live request
HTTP:		200
URL:		https://example.com/

<!doctype html>
<html>…</html>
Show the final response headers only
curl https://example.com -I
Illustrative network snapshot — not a live request
HTTP/2 200
content-type: text/html; charset=UTF-8
cache-control: max-age=86000
Include final response headers
curl https://example.com -i
Illustrative network snapshot — not a live request
HTTP/2 200
content-type: text/html; charset=UTF-8

<!doctype html>
<html>…</html>
Show status, URL, headers and body as structured JSON
curl https://example.com -j
Illustrative network snapshot — not a live request
{
  "status": 200,
  "url": "https://example.com/",
  "headers": [
    "HTTP/2 200",
    "content-type: text/html; charset=UTF-8"
  ],
  "body": "<html>…</html>"
}
Send a request body
curl https://example.com -X POST -d "name=lil"
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Example response to a POST request; the server may reject POST or return another status.
Set the request body; defaults to POST
curl https://example.com -d "name=lil"
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Example response to a POST request; the server may reject POST or return another status.
Add a request header; may be repeated
curl https://example.com -H "Accept: application/json"
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Request contains custom headers; the remote reply depends on the endpoint.
Add a request header; may be repeated
curl https://example.com -H "Accept: application/json" -H "X-Demo: 1"
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Request contains custom headers; the remote reply depends on the endpoint.
Send cookies from a JSON object
curl https://example.com -c '{"theme":"dark"}'
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Request includes Cookie: theme=dark; the server decides how to respond.
Use HTTP Basic authentication through a hidden password prompt
curl https://example.com -u demo
Illustrative network snapshot — not a live request
A separate secret-password prompt appears before the request is sent.
Save the response; use the URL filename when omitted
curl https://example.com -s
Illustrative network snapshot — not a live request
sandbox/
  index.html
The response body is saved on the hosting account.
Reject an unsupported protocol
curl https://example.com -s tmp/example.html
Illustrative network snapshot — not a live request
sandbox/tmp/
  example.html
The response body is saved on the hosting account.
Save the response on the host
curl https://example.com -o tmp/example.html
Illustrative network snapshot — not a live request
sandbox/tmp/
  example.html
The response body is saved on the hosting account.
Append instead of replacing; requires -s or -o
curl https://example.com -o tmp/example.html -a
Illustrative network snapshot — not a live request
sandbox/tmp/
  example.html
The body is appended to the existing file.
Use 5 seconds or a custom timeout from 1 to 300
curl https://example.com -t
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Timeout option changes the maximum wait, not the response format.
Use 5 seconds or a custom timeout from 1 to 300
curl https://example.com -t 2
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Timeout option changes the maximum wait, not the response format.
Use a 300-second timeout
curl https://example.com -T
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Timeout option changes the maximum wait, not the response format.
Use IPv4 or IPv6 when cURL is available
curl https://example.com -4
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Requested IP family IPv4 (requires PHP cURL).
Use IPv4 or IPv6 when cURL is available
curl https://example.com -6
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Requested IP family IPv6 (requires PHP cURL).
Do not follow redirects
curl https://example.com -r
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Redirect following disabled; response status depends on endpoint.
Allow an insecure TLS certificate
curl https://example.com -k
Illustrative network snapshot — not a live request
HTTP: 200
URL: https://example.com/

Certificate verification disabled for this diagnostic request.
Open the response body in the text editor through .lil.tmp
curl https://example.com -edit
Illustrative network snapshot — not a live request
The installed text editor opens the response in a protected temporary file.
Open the response body in the code editor through .lil.tmp
curl https://example.com -code
Illustrative network snapshot — not a live request
The installed code editor opens the response in a protected temporary file.
Show status, URL, headers and body as structured JSON
curl https://example.com -j -code
Illustrative network snapshot — not a live request
The installed code editor opens the response in a protected temporary file as formatted JSON.
Open the response body in the text editor through .lil.tmp
curl https://example.com -edit -s tmp/example.html
Illustrative network snapshot — not a live request
Editor mode cannot be combined with -s or -o
Append instead of replacing; requires -s or -o
curl https://example.com -a
Illustrative network snapshot — not a live request
Append requires an output file
Curl · com
curl ftp://example.com
Illustrative network snapshot — not a live request
Invalid URL
Use IPv4 or IPv6 when cURL is available
curl https://example.com -4 -6
Illustrative network snapshot — not a live request
Choose either IPv4 or IPv6
Set the HTTP method
curl https://example.com -X 9bad
Illustrative network snapshot — not a live request
Invalid HTTP method
Add a request header; may be repeated
curl https://example.com -H "broken"
Illustrative network snapshot — not a live request
Invalid header
Send cookies from a JSON object
curl https://example.com -c not-json
Illustrative network snapshot — not a live request
Invalid cookie JSON
Use 5 seconds or a custom timeout from 1 to 300
curl https://example.com -t 301
Illustrative network snapshot — not a live request
Invalid timeout
Save the response on the host
curl https://example.com -o
Illustrative network snapshot — not a live request
Output file required
Open the response body in the text editor through .lil.tmp
curl https://example.com -edit -code
Illustrative network snapshot — not a live request
Choose one editor

Related documentation

Current public release

v1.2.52026-10-31

Address-family fallback now fails clearly

curl -4/-6 reports when PHP cURL is unavailable, rather than silently using an unfiltered HTTP stream.