Quick Start¶
This guide will walk you through the basic usage of httptap.
Basic Request¶
Run a simple HTTP request and display a rich waterfall view:
This will output a detailed timing breakdown showing:
- DNS resolution time
- TCP connection establishment
- TLS handshake (for HTTPS)
- Time to first byte (TTFB)
- Response body transfer time
Making POST Requests¶
Send JSON data to an API:
Auto-POST behavior
When --data is provided without --method, httptap automatically switches to POST (similar to curl).
Curl-compatible flags
The most common curl flags work unchanged. Use -X/--request for the HTTP method, -L/--location to follow redirects, -m/--max-time for timeouts, -k/--insecure to disable certificate verification, -x for proxies, and --http1.1 to force HTTP/1.1 (equivalent to --no-http2). Not every curl option is supported, so stick to these shared flags when swapping commands.
Load data from a file:
echo '{"title": "New Post", "content": "Hello World"}' > post-data.json
httptap --data @post-data.json https://httpbin.io/post
Using Other HTTP Methods¶
httptap supports all standard HTTP methods:
PUT request:
PATCH request:
DELETE request:
HEAD request (headers only):
Adding Custom Headers¶
Add custom HTTP headers using the -H flag:
Multiple headers can be added by repeating the flag:
httptap \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
https://httpbin.io/bearer
Following Redirects¶
By default, httptap does not follow redirects. To follow redirect chains:
This will show timing information for each step in the redirect chain.
Compact Output¶
For single-line output suitable for logging:
Output example:
Metrics-Only Mode¶
Get raw metrics without formatting, perfect for scripts:
Output example:
Step 1: dns=30.1 connect=97.3 tls=199.0 ttfb=472.2 total=476.0 status=200 bytes=389 ip=44.211.11.205 family=IPv4 tls_version=TLSv1.2
JSON Export¶
Export full request data to JSON for later analysis:
The JSON file will contain:
- Detailed timing for all phases
- Network information (IP, TLS version, certificate details)
- Response metadata (status, headers, body size)
- Full redirect chain (if
--followis used)
Common Use Cases¶
API Testing¶
Test a complete REST API workflow:
# Create a resource
httptap --data '{"title": "Test Post"}' https://httpbin.io/post
# Update the resource
httptap --method PUT --data '{"title": "Updated Post"}' https://httpbin.io/put
# Partial update
httptap --method PATCH --data '{"published": true}' https://httpbin.io/patch
# Delete the resource
httptap --method DELETE https://httpbin.io/delete
Check API Latency¶
Debug Slow Responses¶
The waterfall view will help identify which phase is causing the delay (DNS, connection, TLS, or server processing).
Verify TLS Configuration¶
Check the TLS version, cipher suite, and certificate expiration in the output.
Performance Benchmarking¶
Establish performance baselines and track changes over time:
# Collect 10 samples and calculate statistics
for i in {1..10}; do
httptap --metrics-only https://httpbin.io/delay/1
done | awk '/total=/ {
# Extract total value
for (i = 1; i <= NF; i++) {
if ($i ~ /^total=/) {
sub(/^total=/, "", $i)
sum += $i
values[++count] = $i
break
}
}
}
END {
if (count > 0) {
avg = sum / count
printf "Average: %.1f ms\n", avg
printf "Samples: %d\n", count
# Calculate min/max
min = values[1]; max = values[1]
for (i = 1; i <= count; i++) {
if (values[i] < min) min = values[i]
if (values[i] > max) max = values[i]
}
printf "Min: %.1f ms\n", min
printf "Max: %.1f ms\n", max
printf "Range: %.1f ms\n", (max - min)
}
}'
Example output:
This helps identify performance variability and establish reliable baselines for regression testing.
What's Next?¶
-
Complete command-line reference
-
Rich, compact, JSON, and metrics modes
-
Extend httptap with custom components