Skip to content

This project is a command-line tool that works like a lightweight Postman for the terminal. It lets you send HTTP requests (GET, POST, PUT, PATCH, DELETE) with optional headers and JSON bodies, and then formats both the request and response. It’s built with Python, Typer (for CLI commands), Requests (for HTTP), and Rich (for styling).

License

Notifications You must be signed in to change notification settings

Poorna-Raj/Http-Caller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HttpCaller

A simple terminal-based HTTP client built with Python, Typer, and Rich. It allows you to make HTTP requests (GET, POST, PUT, DELETE, etc.) and view request and response data with a clean, colored UI. JSON responses are syntax-highlighted with line numbers.

Features

  • Make HTTP requests using any method (GET, POST, PUT, DELETE, etc.)

  • Pass optional JSON body data with --data (-d) option

  • Pass optional HTTP headers with --header (-H) option (key:value format)

  • Pretty-print request and response data using Rich panels

  • Syntax-highlight JSON responses with line numbers

  • Handles invalid JSON responses gracefully

Installation

  1. Clone the repository:
git clone https://github.com/Poorna-Raj/Http-Caller.git
cd Http-Caller
  1. Install dependencies
pip install -r requirements.txt

Usage

Run the tool from the terminal:

python httpCaller.py METHOD URL [--d '{"key":"value"}'] [--H '{"Key":"Value"}']

Examples

  • GET Request:
python httpCaller.py GET https://jsonplaceholder.typicode.com/posts/1
  • POST request with JSON body:
python httpCaller.py POST https://jsonplaceholder.typicode.com/posts \
    --d '{"title": "Hello", "body": "World"}'
  • GET request with headers:
python httpCaller.py GET https://api.example.com/data \
    --H "Authorization: Bearer <token>"

Screenshots

  1. GET Request Screenshot of GET Request
  2. POST Request Screenshot of POST Request
  3. PUT Request Screenshot of PUT Request
  4. DELETE Request Screenshot of DELETE Request

Notes

  • JSON responses must be valid. Invalid JSON will be displayed as plain text.

  • Headers must follow the Key:Value format. Multiple headers are not supported yet.

License

MIT License © Poorna Rajapaksha

About

This project is a command-line tool that works like a lightweight Postman for the terminal. It lets you send HTTP requests (GET, POST, PUT, PATCH, DELETE) with optional headers and JSON bodies, and then formats both the request and response. It’s built with Python, Typer (for CLI commands), Requests (for HTTP), and Rich (for styling).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages