Overview & Subcommands
NitroHttp CLI (nhttp) is the command-line companion to NitroHttp. It is a blazing-fast HTTP testing tool for rapid API validation directly from the terminal, featuring syntax-highlighted JSON rendering, structured table views, and rich response statistics.
| Subcommand | Short Alias | Description |
|---|---|---|
| get | g | Fetch resources and render formatted JSON in a bordered table with response statistics. |
| post | p | Create a resource or submit inline JSON payload or file contents to an endpoint. |
| put | pu | Replace a target resource entirely with JSON content from string or file. |
| patch | pa | Update part of a resource with partial JSON payload. |
| delete | del | Remove a remote resource by ID or query endpoint. |
Installation & Verification
NitroHttp is pre-installed on Nitro OS. You can also install or update it as a global .NET tool or compile it with Native AOT for instant sub-millisecond execution:
# Install via .NET Tool
dotnet tool install -g NitroHttp
# Verify installation & view help
nhttp --help
# Update to the latest release
dotnet tool update -g NitroHttp
# Uninstall if needed
dotnet tool uninstall -g NitroHttpGeneral Usage & Syntax Rules
The standard invocation syntax for all commands:
nhttp <command> --url <endpoint> [--body <json-or-file>]–url is required
Every command requires a target URL. If no protocol is provided, https:// is automatically prepended.
–body for payloads
Required for post, put, and patch. Sent as application/json automatically.
Automatic file reading
If –body points to an existing file path (e.g. ./payload.json), nhttp reads and transmits file contents.
Stats panel
Displays HTTP status code, response time in ms, payload byte size, and array/object item counts.
GET Requests & JSON Rendering
Fetch endpoints with automatic formatted JSON tables and timing statistics:
# Standard GET command
nhttp get --url https://jsonplaceholder.typicode.com/users
# Using short alias and implicit https://
nhttp g --url jsonplaceholder.typicode.com/postsPOST, PUT & PATCH with Inline/File Payloads
Transmit payloads using either inline JSON strings or existing local JSON file paths:
# POST with inline JSON string
nhttp post --url https://jsonplaceholder.typicode.com/users --body '{"name":"Ada Lovelace"}'
# POST with JSON file payload
nhttp p --url jsonplaceholder.typicode.com/users --body ./payloads/user.json
# PUT full update
nhttp put --url https://jsonplaceholder.typicode.com/users/42 --body ./payloads/user-update.json
# PATCH partial update
nhttp patch --url https://jsonplaceholder.typicode.com/users/42 --body '{"title":"Lead Systems Engineer"}'DELETE Requests
Remove remote records and inspect status codes:
# Standard DELETE
nhttp delete --url https://jsonplaceholder.typicode.com/users/42
# Using short alias
nhttp del --url jsonplaceholder.typicode.com/posts/10Response Output & Stats Panel
Every response renders with an integrated diagnostic panel:
- Status Text & Code: Visual indicators for 2xx, 3xx, 4xx, and 5xx responses.
- Latency & Elapsed Time: High-precision millisecond timing for request lifecycle.
- Payload Size: Human-readable byte formatting (e.g.
1.42 KB). - Item Count: Automatic length detection for JSON arrays and object collections.