httpie

httpie is an HTTP client for human beings.

Syntax

Invoke http (or https) as follows:

  • Flags:
    • -f or --form send form-encoded payloads.
    • --multipart specifies a multipart/form-data payload.
    • --offline performs a dry-run, allowing printing the request headers and body.
  • HTTP method, either standardised (HEAD, GET, POST, PUT, PATCH, DELETE, etc.) or custom.
  • URL:
    • You may omit the scheme, and may leave or retain the :// delimiter. The default scheme depends upon the invoked command.
    • : refers to localhost. :8080 refers to localhost:8080.
  • Items:
    • Header:value specifies a header name-value pair.
    • key=value specifies a key-value pair. By default these are included in a JSON payload.
    • param==value specifies a query string parameter.
    • param==@file reads the contents of the file into the named parameter.
    • param[nestedParam][]=foo allows specifying deeply nested structures.
    • key:=["a","b","c"] specifies a raw JSON key-value pair.
    • field@/path uploads the named file in the specified form field.

Backlinks