Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Trackable Request Logger

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.


📌 Features

  • 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

📥 Installation

  1. Clone this repository or download the script.
  2. Install required dependencies:
    pip install requests
  3. Run the program:
    python your_script.py

🚀 How to Use

1️⃣ Initialize the Request Logger

from trackable_requests import trackable_request

request_logger = trackable_request()
request_logger.headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "User-Agent": "CustomLogger/1.0"
}

2️⃣ Make API Calls

response = request_logger.get("https://jsonplaceholder.typicode.com/posts/1")
print(response)

3️⃣ Export Requests to an HTML Report

request_logger.export_html("request_log.html")

🖥️ HTML Report Overview

  • 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.

📌 Example Report Screenshot

Report Example Screenshot


🛠️ Configuration

  • To redact the header Authorization in the report, set redact_authorization_header=True:
    request_logger.export_html("request_log.html", redact_authorization_header=True)

📂 Project Structure

/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

🚀 Now you can easily track and visualize your API requests with an intuitive report!

About

Creates a timeline of all requests sent. Exports to HTML.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages