This Python program provides an enhanced HTTP request logger with response tracking, error handling, and an exportable HTML report featuring a modern timeline layout. The requests and headers are structured consistently, making it easy to analyze API interactions.
- ✅ Track HTTP Requests (GET, POST, PUT, PATCH, DELETE)
- ✅ Log Response Time & Request Timestamps
- ✅ Export API Logs to an HTML Report
- ✅ Modern Timeline UI for Requests
- ✅ Headers & Requests Displayed in a Unified Layout
- Clone this repository or download the script.
- Install required dependencies:
pip install requests
- Run the program:
python your_script.py
from trackable_requests import trackable_request
request_logger = trackable_request()
request_logger.headers = {
"Authorization": "Bearer YOUR_TOKEN",
"User-Agent": "CustomLogger/1.0"
}response = request_logger.get("https://jsonplaceholder.typicode.com/posts/1")
print(response)request_logger.export_html("request_log.html")- Headers are displayed at the top in a structured card.
- Requests appear in a timeline view for easy tracking.
- Timestamps and response times are logged for performance analysis.
- Errors are displayed only if they occur.
- To redact the header
Authorizationin the report, setredact_authorization_header=True:request_logger.export_html("request_log.html", redact_authorization_header=True)
/your_project
│── trackable_requests.py # Main request logging class
│── example_script.py # Example usage script
│── request_log.html # Generated HTML report
│── README.md # This file
