Skip to content

Releases

rq v1.2.0

Choose a tag to compare

@mohamadKrayem mohamadKrayem released this 10 Sep 11:55

First release since v1.1.0 (December 2023). The tool is now called rq. It builds requests from HTTPie-style request items, and its network defaults are safer. Several of those defaults change behaviour, so read Upgrading from v1.1.0 before you update scripts.

Install

go install github.com/mohamadkrayem/requestCLI/cmd/rq@latest

Or download the archive for your platform below and put rq on your PATH. Checksums are in SHA256SUMS.

Upgrading from v1.1.0

  • The binary is renamed to rq. requestCLI keeps working for this release: as a symlink inside the Linux and macOS archives, and through the old go install github.com/mohamadkrayem/requestCLI@latest path. Either way it prints a deprecation notice on stderr, and it will be removed in the next release. If you install with go install, switch to the cmd/rq path above. The module root installs a binary named requestCLI.
  • TLS certificates are verified. v1.1.0 skipped verification on every HTTPS request. Pass -k / --insecure for a self-signed certificate you trust.
  • Scheme-less URLs default to https, except localhost, 127.0.0.1 and [::1]. Pass --http to force plain HTTP.
  • Requests time out after 30s by default. Change it with --timeout.
  • Response bodies are shown exactly as received. JSON is formatted from the raw bytes instead of being decoded, so key order, large integers and duplicate keys now match what the server sent. Expect output diffs against v1.1.0.
  • Colour is only emitted on a terminal, and never when NO_COLOR is set, so piped output is clean.
  • --Redirect is now --redirect, and --secure / -s does nothing because HTTPS is the default. Both old flags are still accepted, with a warning.

New

  • Request items: headers, query parameters and body without JSON quoting.
    rq post example.com/login username=Mohamad age:=22 X-Api-Token:abc123 page==2 avatar@./me.png
    Integers of any size reach the server byte-exact, and body keys keep the order you typed.
  • Piped stdin body: echo '{"a":1}' | rq post example.com. Use --ignore-stdin to opt out.
  • -v / --verbose prints the request that was actually sent, including default, auth and cookie headers.
  • --check-status exits 3, 4 or 5 on a 3xx, 4xx or 5xx response (HTTPie's codes). Exit code 2 now means a transport failure, so scripts can tell "server said 404" from "server unreachable".
  • Syntax highlighting for XML, YAML, JavaScript, CSS, TOML, SQL, Markdown and GraphQL, with --style to pick the theme. Binary bodies are described instead of dumped to the terminal.
  • -S, -H and -B combine, so -H -B prints headers and body.
  • Shell completions: rq completion bash|zsh|fish.
  • A Dockerfile and docker-compose fixture server. No image is published.

Fixed

  • rq trace sent a CONNECT request.
  • put, head, options and patch crashed when given no URL. A blank line in --body / --headers input and one-character multipart field names also crashed.
  • Query parameters from two sources produced a malformed ?a=1?b=2 URL.
  • Integers beyond 2^53 were rounded in displayed JSON, and in key:=value items on GET.
  • Newlines were stripped out of string values in displayed JSON.
  • --headers --body together dropped the body.
  • -f discarded headers passed with -n.
  • A non-JSON body could never fall back to text/plain.
  • Piping an HTML response emitted raw colour escape codes.

Downloads

Platform Archive
Linux x86-64 rq_1.2.0_linux_amd64.tar.gz
Linux ARM64 rq_1.2.0_linux_arm64.tar.gz
macOS Intel rq_1.2.0_darwin_amd64.tar.gz
macOS Apple silicon rq_1.2.0_darwin_arm64.tar.gz
Windows x86-64 rq_1.2.0_windows_amd64.zip
Windows ARM64 rq_1.2.0_windows_arm64.zip

The binaries are static (CGO disabled). The macOS binaries are not notarized, so on first run you may need xattr -d com.apple.quarantine ./rq.