OS Manuals

/usr/bin/xh

Friendly and fast tool for sending HTTP requests.

From xh 0.26.3-r1 (os), captured 2026-11-05 by running xh --help (exit 0). permalink

xh is a friendly and fast tool for sending HTTP requests

Usage: xh [OPTIONS] <[METHOD] URL> [REQUEST_ITEM]...

Arguments:
  <[METHOD] URL>     The request URL, preceded by an optional HTTP method
  [REQUEST_ITEM]...  Optional key-value pairs to be included in the request.

Options:
  -j, --json
          (default) Serialize data items from the command line as a JSON object
  -f, --form
          Serialize data items from the command line as form fields
      --multipart
          Like --form, but force a multipart/form-data request even without files
      --raw <RAW>
          Pass raw request data without extra processing
      --pretty <STYLE>
          Controls output processing [possible values: all, colors, format, none]
      --format-options <FORMAT_OPTIONS>
          Set output formatting options
  -s, --style <THEME>
          Output coloring style [possible values: auto, solarized, monokai, fruity]
      --response-charset <ENCODING>
          Override the response encoding for terminal display purposes
      --response-mime <MIME_TYPE>
          Override the response mime type for coloring and formatting for the terminal
  -p, --print <FORMAT>
          String specifying what the output should contain
  -h, --headers
          Print only the response headers. Shortcut for --print=h
  -b, --body
          Print only the response body. Shortcut for --print=b
  -m, --meta
          Print only the response metadata. Shortcut for --print=m
  -v, --verbose...
          Print the whole request as well as the response
      --debug
          Print full error stack traces and debug log messages
      --all
          Show any intermediary requests/responses while following redirects with --follow
  -P, --history-print <FORMAT>
          The same as --print but applies only to intermediary requests/responses
  -q, --quiet...
          Do not print to stdout or stderr
  -S, --stream
          Always stream the response body
  -x, --compress...
          Content compressed (encoded) with Deflate algorithm
  -o, --output <FILE>
          Save output to FILE instead of stdout
  -d, --download
          Download the body to a file instead of printing it
  -c, --continue
          Resume an interrupted download. Requires --download and --output
      --session <FILE>
          Create, or reuse and update a session
      --session-read-only <FILE>
          Create or read a session without updating it from the request/response exchange
  -A, --auth-type <AUTH_TYPE>
          Specify the auth mechanism [possible values: basic, bearer, digest]
  -a, --auth <USER[:PASS] | TOKEN>
          Authenticate as USER with PASS (-A basic|digest) or with TOKEN (-A bearer)
      --ignore-netrc
          Do not use credentials from .netrc
      --offline
          Construct HTTP requests without sending them anywhere
      --check-status
          (default) Exit with an error status code if the server replies with an error
  -F, --follow
          Do follow redirects
      --max-redirects <NUM>
          Number of redirects to follow. Only respected if --follow is used
      --timeout <SEC>
          Connection timeout of the request
      --proxy <PROTOCOL:URL>
          Use a proxy for a protocol. For example: --proxy https:http://proxy.host:8080
      --verify <VERIFY>
          If "no", skip SSL verification. If a file path, use it as a CA bundle
      --cert <FILE>
          Use a client side certificate for SSL
      --cert-key <FILE>
          A private key file to use with --cert
      --ssl <VERSION>
          Force a particular TLS version [possible values: auto, tls1, tls1.1, tls1.2, tls1.3]
      --https
          Make HTTPS requests if not specified in the URL
      --http-version <VERSION>
          HTTP version to use [possible values: 1.0, 1.1, 2, 2-prior-knowledge, 3-prior-knowledge]
      --resolve <HOST:ADDRESS>
          Override DNS resolution for specific domain to a custom IP
      --interface <NAME>
          Bind to a network interface or local IP address
  -4, --ipv4
          Resolve hostname to ipv4 addresses only
  -6, --ipv6
          Resolve hostname to ipv6 addresses only
      --unix-socket <FILE>
          Connect using a Unix domain socket
  -I, --ignore-stdin
          Do not attempt to read stdin
      --curl
          Print a translation to a curl command
      --curl-long
          Use the long versions of curl's flags
      --generate <KIND>
          Generate shell completions or man pages
      --help
          Print help
  -V, --version
          Print version

Each option can be reset with a --no-OPTION argument.

Run "xh help" for more complete documentation.
Options (50)
OptionDescriptionSource
-j, --json(default) Serialize data items from the command line as a JSON objecthelp
-f, --formSerialize data items from the command line as form fieldshelp
--multipartLike --form, but force a multipart/form-data request even without fileshelp
--raw RAWPass raw request data without extra processinghelp
--pretty STYLEControls output processing [possible values: all, colors, format, none]help
--format-options FORMAT_OPTIONSSet output formatting optionshelp
-s, --style THEMEOutput coloring style [possible values: auto, solarized, monokai, fruity]help
--response-charset ENCODINGOverride the response encoding for terminal display purposeshelp
--response-mime MIME_TYPEOverride the response mime type for coloring and formatting for the terminalhelp
-p, --print FORMATString specifying what the output should containhelp
-h, --headersPrint only the response headers.help
-b, --bodyPrint only the response body.help
-m, --metaPrint only the response metadata.help
-v, --verbosePrint the whole request as well as the responsehelp
--debugPrint full error stack traces and debug log messageshelp
--allShow any intermediary requests/responses while following redirects with --followhelp
-P, --history-print FORMATThe same as --print but applies only to intermediary requests/responseshelp
-q, --quietDo not print to stdout or stderrhelp
-S, --streamAlways stream the response bodyhelp
-x, --compressContent compressed (encoded) with Deflate algorithmhelp
-o, --output FILESave output to FILE instead of stdouthelp
-d, --downloadDownload the body to a file instead of printing ithelp
-c, --continueResume an interrupted download.help
--session FILECreate, or reuse and update a sessionhelp
--session-read-only FILECreate or read a session without updating it from the request/response exchangehelp
-A, --auth-type AUTH_TYPESpecify the auth mechanism [possible values: basic, bearer, digest]help
--ignore-netrcDo not use credentials from .netrchelp
--offlineConstruct HTTP requests without sending them anywherehelp
--check-status(default) Exit with an error status code if the server replies with an errorhelp
-F, --followDo follow redirectshelp
--max-redirects NUMNumber of redirects to follow.help
--timeout SECConnection timeout of the requesthelp
--proxy PROTOCOL:URLUse a proxy for a protocol.help
--verify VERIFYIf "no", skip SSL verification.help
--cert FILEUse a client side certificate for SSLhelp
--cert-key FILEA private key file to use with --certhelp
--ssl VERSIONForce a particular TLS version [possible values: auto, tls1, tls1.1, tls1.2, tls1.3]help
--httpsMake HTTPS requests if not specified in the URLhelp
--http-version VERSIONHTTP version to use [possible values: 1.0, 1.1, 2, 2-prior-knowledge, 3-prior-knowledge]help
--resolve HOST:ADDRESSOverride DNS resolution for specific domain to a custom IPhelp
--interface NAMEBind to a network interface or local IP addresshelp
-4, --ipv4Resolve hostname to ipv4 addresses onlyhelp
-6, --ipv6Resolve hostname to ipv6 addresses onlyhelp
--unix-socket FILEConnect using a Unix domain sockethelp
-I, --ignore-stdinDo not attempt to read stdinhelp
--curlPrint a translation to a curl commandhelp
--curl-longUse the long versions of curl's flagshelp
--generate KINDGenerate shell completions or man pageshelp
--helpPrint helphelp
-V, --versionPrint versionhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.