Skip to main content

runhttp

Run .http files from the command line. You already have .http files — the ones VS Code's REST Client extension runs. runhttp runs the same files in your terminal and in CI. Zero dependencies, no Electron, no account, no config.

# api.http
@base = https://api.example.com
@token = {{$env API_TOKEN}}

### Get the current user
GET {{base}}/me
Authorization: Bearer {{token}}
Accept: application/json
runhttp api.http
GET https://api.example.com/me   # Get the current user
  200 OK · 142ms · application/json · 318 B
  {
    "id": 7,
    "name": "Ada Lovelace"
  }

Why

You want to fire off a saved HTTP request and see the response. The options:

  • Postman / Insomnia — a whole GUI app and an account, to send one GET.
  • Hurl is great, but uses its own .hurl format — your existing VS Code .http files don't run in it.
  • httpyac runs .http files but pulls in dozens of dependencies.
  • curl works, but now you're translating a clean .http file into a wall of -H flags every time.

runhttp runs the .http files you already keep next to your code. Pure standard library — pipx/npx and go.

Usage

runhttp api.http               # run every request in order
runhttp api.http -n 2          # run only request #2 (1-based)
runhttp api.http --name login  # run the request titled "### login"
runhttp api.http --list        # list requests without sending
cat api.http | runhttp         # read from stdin
Option
-n, --request <n> run only the nth request
--name <title> run the request with this ### title / # @name
--list print requests, don't send
--var k=v define/override a variable (repeatable)
-i, --include print response headers
--json emit results as a JSON array (stdout)
--no-follow don't follow redirects (default: follow, max 5)
--insecure skip TLS verification
--timeout <sec> per-request timeout (default 30)

Variables

@base = https://api.example.com      # file variable
GET {{base}}/users                   # {{name}} to use it
Authorization: Bearer {{$env TOKEN}} # {{$env NAME}} reads the environment

Override or supply any variable from the command line with --var name=value. An undefined variable is an error — a typo never gets silently sent.

Exit codes

0   every request came back < 400
1   some request returned an HTTP status >= 400
2   parse error, connection failure, or bad usage
runhttp smoke.http && echo "all endpoints healthy"

Scope (on purpose)

Supports the everyday .http: @variables, {{vars}} / {{$env}}, request titles, headers, request bodies, multiple requests per file, and redirect following. It does not do gRPC/WebSocket/GraphQL transports or response assertions — if you need those, reach for httpyac or Hurl. runhttp is the small, dependency-free one for the 90% case.

Install

pip install runhttp        # Python >= 3.8
npx runhttp api.http       # Node >= 18 (byte-for-byte port)

License

MIT

Metadata

Release files for runhttp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runhttp 0.1.0
File Size Uploaded Provenance Actions
runhttp-0.1.0.tar.gz 12.3 kB Without provenance Details for runhttp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runhttp 0.1.0
File Interpreter ABI Platform Actions
runhttp-0.1.0-py3-none-any.whl Python 3 none any Details for runhttp-0.1.0-py3-none-any.whl

Total release size: 23.0 kB

Release files / runhttp-0.1.0.tar.gz

Download URL runhttp-0.1.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1f26e19e280bd9ddcf0dfc66b1618316e94f9c2c5a118c58b8d2659cd0ba8fd3
BLAKE2b-256 checksum
How to use checksums
ee534cd2069d7ac0795ac69a968faf58166ac94f56e19cfe46dafc3fbdbf4c0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / runhttp-0.1.0-py3-none-any.whl

Download URL runhttp-0.1.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e34b6ae25dec2d1364c0bb715ed07b7dd05c7e730987a77a5862d064d0ab2c34
BLAKE2b-256 checksum
How to use checksums
7f6059ec8eb76771f6340e22a5580b8790ae79c0ac7c537b87852f8b4939ad61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for runhttp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page