HTTP Request Builder
by @derick001
Build, test, and save HTTP requests from the CLI with custom headers, auth, body, cookies, templates, interactive mode, and request history tracking.
clawhub install http-request-builderπ About This Skill
name: http-request-builder description: Build and test HTTP requests with CLI interface: headers, auth, body, cookies, with history and templates. version: 1.0.0 author: skill-factory metadata: openclaw: requires: bins: - python3 python: - requests
HTTP Request Builder
What This Does
A CLI tool to build, test, and save HTTP requests. Send requests with custom headers, authentication, body, and cookies. Save requests as templates for reuse and maintain a history of your HTTP calls.
Key features:
When To Use
Usage
Basic commands:
# Send a GET request
python3 scripts/main.py get https://api.example.com/dataSend a POST request with JSON body
python3 scripts/main.py post https://api.example.com/api \
--header "Content-Type: application/json" \
--body '{"name": "test", "value": 123}'Send with Basic authentication
python3 scripts/main.py get https://api.example.com/secure \
--auth basic --username admin --password secretSend with Bearer token
python3 scripts/main.py get https://api.example.com/secure \
--auth bearer --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"Save request as template
python3 scripts/main.py post https://api.example.com/api \
--header "Content-Type: application/json" \
--body '{"name": "test"}' \
--save-template my-requestLoad and execute template
python3 scripts/main.py template my-requestInteractive mode
python3 scripts/main.py interactiveView request history
python3 scripts/main.py historyClear history
python3 scripts/main.py history --clear
Examples
Example 1: Simple GET request
python3 scripts/main.py get https://jsonplaceholder.typicode.com/posts/1
Output:
Response Status: 200 OK
Response Headers:
content-type: application/json; charset=utf-8
...Response Body:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
Example 2: POST request with JSON body and headers
python3 scripts/main.py post https://jsonplaceholder.typicode.com/posts \
--header "Content-Type: application/json" \
--header "X-API-Key: my-secret-key" \
--body '{
"title": "foo",
"body": "bar",
"userId": 1
}'
Example 3: Save and reuse request template
# Save template
python3 scripts/main.py post https://api.example.com/users \
--header "Content-Type: application/json" \
--header "Authorization: Bearer token123" \
--body '{"name": "New User"}' \
--save-template create-userUse template later
python3 scripts/main.py template create-userList all templates
python3 scripts/main.py templates
Example 4: Interactive mode
python3 scripts/main.py interactive
Interactive mode guides you through: 1. HTTP method selection 2. URL input 3. Headers configuration 4. Authentication setup 5. Request body input 6. Send request and view results
Requirements
requests library (installed automatically or via pip)Install missing dependencies:
pip3 install requests
Limitations
~/.http-request-builder/Directory Structure
The tool stores data in ~/.http-request-builder/:
templates/ - Saved request templates (JSON files)history.json - Request history logconfig.json - Configuration (if any)Error Handling
Contributing
This is a skill built by the Skill Factory. Issues and improvements should be reported through the OpenClaw project.
β‘ When to Use
π‘ Examples
Example 1: Simple GET request
python3 scripts/main.py get https://jsonplaceholder.typicode.com/posts/1
Output:
Response Status: 200 OK
Response Headers:
content-type: application/json; charset=utf-8
...Response Body:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
Example 2: POST request with JSON body and headers
python3 scripts/main.py post https://jsonplaceholder.typicode.com/posts \
--header "Content-Type: application/json" \
--header "X-API-Key: my-secret-key" \
--body '{
"title": "foo",
"body": "bar",
"userId": 1
}'
Example 3: Save and reuse request template
# Save template
python3 scripts/main.py post https://api.example.com/users \
--header "Content-Type: application/json" \
--header "Authorization: Bearer token123" \
--body '{"name": "New User"}' \
--save-template create-userUse template later
python3 scripts/main.py template create-userList all templates
python3 scripts/main.py templates
Example 4: Interactive mode
python3 scripts/main.py interactive
Interactive mode guides you through: 1. HTTP method selection 2. URL input 3. Headers configuration 4. Authentication setup 5. Request body input 6. Send request and view results