DotURL: Http Client Tool
The DotHRB DotURL command-line tool provides a powerful, code-free way to execute HTTP REST operations directly from your terminal. It's ideal for testing APIs, automation scripting, and quick network requests.
Usage Syntax
doturl [options] <json file | "json string">
The tool accepts either a JSON file containing commands or a JSON string defining a single operation.
1. ⚙️ Core Options and Output Control
These options manage help, verbosity, and the formatting of the output.
| Option | Shorthand | Description |
|---|---|---|
-h / -help | (None) | Display the help documentation. |
| (None) | -v | Enable Verbose output for detailed request/response logging. |
| (None) | -o | Set an output file path to save the response content. |
-p <s|h|b> | (None) | Control the print output components: r (Status), h (Headers), b (Body). Default is to print all three. |
--license | (None) | Display license and copyright information. |
--version | (None) | Display the tool version number. |
2. ⌨️ Command History
These commands are used for accessing command history.
| Command | Description |
|---|---|
: | List the history of log entries (previous commands). |
:? <search> | List log entries that contain the specified <search> string. |
:<n> | Recall and execute log entry number <n>. |
:$ | Recall and execute the last log entry. |
:@<template> | Recall a template**. |
3. 📝 Practical Examples
These examples demonstrate how to execute operations using external files or inline JSON strings.
| Scenario | Command | Purpose |
|---|---|---|
| Execute Command File | doturl myscript.json | Executes the set of defined HTTP requests contained within the JSON file. |
| Inline JSON GET | doturl '{"cmd":"post","url":"http://localhost","headers":"..."}' | Executes an HTTP GET operation |
| Inline JSON POST | doturl '{"cmd":"post","url":"http://localhost","body":"...", "headers":"..."}' | Executes an HTTP POST operation using an inline JSON string definition. |