test-api-endpoints
v1.1.4
Published
A cli tool to test API endpoints
Readme
API Request CLI Tool
A powerful and interactive Command Line Interface (CLI) tool to test your APIs directly from the terminal — similar to Postman, but faster and developer-friendly.
Features
- Supports HTTP methods:
GET,POST,PUT,DELETE - Interactive CLI prompts
- Send JSON body for requests
- JWT Authentication support
- Clean and readable response output
- Beginner-friendly and lightweight
Installation
Or run locally:
npx test-api-endpointsInstall globally using npm:
npm install -g test-api-endpointsUsage
npx test-api-endpointsFollow the prompts:
✔ Select request type: POST
✔ Enter localhost URL: http://localhost:3000
✔ Enter API endpoint: /api/v1/users/register
✔ Enter JSON body for POST request:
✔ Enter JWT token (leave empty if none):Example JSON Input
When prompted for JSON body, enter:
{
"name": "user",
"email": "[email protected]",
"username": "user_123",
"password": "secure123"
}Important:
- Do NOT wrap JSON in quotes
- Use double quotes for keys and values
- Ensure valid JSON format
JWT Authentication
If your API requires authentication:
- Enter your JWT token when prompted
- It will be automatically added as:
Authorization: Bearer <your_token>Tech Stack
- Node.js
- Axios
- Inquirer (for CLI prompts)
Common Errors
Invalid JSON Error
Unexpected token ... is not valid JSONFix:
- Remove single quotes
- Ensure proper JSON format
Author
codeurge316 - @yashbansal
License
ISC License
