Make HTTP requests to external APIs. Supports GET, POST, PUT, DELETE with JSON and form data. Use for fetching data, calling APIs, and webhooks.
Make HTTP requests to external APIs and services.
node /path/to/skills/http-client/scripts/request.js GET https://api.example.com/data
node /path/to/skills/http-client/scripts/request.js POST https://api.example.com/users '{"name":"John"}'
node /path/to/skills/http-client/scripts/request.js GET https://api.example.com/data --header "Authorization: Bearer token123"
General-purpose HTTP request script.
Usage:
node request.js <METHOD> <URL> [BODY] [OPTIONS]
Options:
--header "Key: Value" - Add custom header (can be used multiple times)--output <file> - Save response to file--timeout <ms> - Request timeout (default: 30000)Simplified script for JSON APIs.
Usage:
node fetch-json.js <URL> [--post '{"data":"value"}']
node request.js GET https://jsonplaceholder.typicode.com/posts/1
node request.js POST https://httpbin.org/post '{"key":"value"}' --header "Content-Type: application/json"
node request.js GET https://example.com/file.pdf --output downloaded.pdf
The script outputs JSON with:
{
"status": 200,
"headers": { "content-type": "application/json" },
"body": { "response": "data" }
}