Skip to content

httptap

httptap

PyPI Python Versions CI Coverage

httptap is a rich-powered CLI that dissects an HTTP request into every meaningful phase—DNS, TCP connect, TLS handshake, server wait, and body transfer—and renders the results as a timeline table, compact summary, or machine-friendly metrics. It is designed for interactive troubleshooting, regression analysis, and recording of performance baselines.

Special Offer

🎁 Save 50% on GitKraken Pro

Bundle GitKraken Client, GitLens for VS Code, and powerful CLI tools to accelerate every repo workflow.

Exclusive for httptap community

Highlights

  • Phase-by-phase timing – precise measurements built from httpcore trace hooks (with sane fallbacks when metal-level data is unavailable)
  • All HTTP methods – GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS with request body support
  • Request body support – send JSON, XML, or any data inline or from file with automatic Content-Type detection
  • IPv4/IPv6 aware – the resolver and TLS inspector report both the address and its family; -4/-6 restrict resolution to one family, and --resolve HOST:PORT:ADDR pins a host to an address while keeping the original Host header and TLS SNI
  • TLS insights – certificate CN, SANs, issuer, serial, validity window and expiry countdown, plus cipher suite and protocol version, are captured automatically from the live connection (no extra handshake)
  • Multiple output modes – rich waterfall view, compact single-line summaries, or --metrics-only for scripting
  • JSON export – persist full step data (including redirect chains) for later processing, or stream it to stdout with --json -
  • Prometheus and OpenTelemetry export – --prometheus PATH writes a node_exporter textfile; --otlp ENDPOINT sends per-phase spans to an OTLP/HTTP collector (requires httptap[otel])
  • SLO threshold checking – --slo and --slo-file gate CI jobs, cron probes, and readiness checks on per-phase latency budgets
  • Scriptable exit codes – -f/--fail exits 22 on HTTP 4xx/5xx responses, and SLO violations, network errors, and the redirect limit each have their own exit code
  • Extensible – clean Protocol interfaces for DNS, TLS, timing, visualization, and export so you can plug in custom behavior

Quick Examples

GET request:

httptap https://httpbin.io/get

POST with JSON data:

httptap --data '{"name": "John"}' https://httpbin.io/post

Sample Output

Key Features

Rich Waterfall Visualization

View detailed timing breakdown for each phase of the HTTP request with a beautiful terminal UI powered by Rich.

Multiple Output Formats

  • Rich mode (default): Beautiful waterfall table with colors and formatting
  • Compact mode (--compact): Single-line summaries suitable for logs
  • Metrics mode (--metrics-only): Raw metrics for scripting and automation
  • JSON export (--json): Full request data including redirect chains, to a file or to stdout with --json -
  • Prometheus textfile (--prometheus): Per-phase gauges for the node_exporter textfile collector
  • OpenTelemetry traces (--otlp): One span per request with child spans per phase, sent to an OTLP/HTTP collector

Advanced Network Insights

  • DNS resolution timing with IP family detection (IPv4/IPv6)
  • TCP connection establishment timing
  • TLS handshake analysis with certificate information
  • Time to first byte (TTFB) measurement
  • Response body transfer timing

Redirect Chain Support

Follow HTTP redirects and see timing breakdown for each step in the chain with --follow flag.

What's Next?

Requirements

  • Python 3.11-3.15
  • macOS, Linux, or Windows
  • No system dependencies beyond standard networking

License

Apache License 2.0 © Sergei Ozeranskii

Connect

Follow the author for insights from real-world experience:

  • Telegram Channel - Development, DevOps, architecture, and security. Real experience and practical insights without fluff.
  • GitHub - Open source projects and contributions

Acknowledgements

Built on the shoulders of fantastic libraries:

  • httpx - Modern HTTP client
  • httpcore - Low-level HTTP protocol implementation
  • cryptography - X.509 certificate parsing
  • Rich - Beautiful terminal formatting