httpdump
Parse HTTP requests and responses into JSON.
Installation
uv sync
Usage
# Parse HTTP request from stdin
nc -lp 8080 | uv run httpdump
# Parse HTTP response
curl -si https://example.com | uv run httpdump --response
# Parse from file
uv run httpdump request.txt
uv run httpdump --response response.txt
Output Format
Request
{
"method": "POST",
"url": "/api/users?page=1",
"path": "/api/users",
"query_params": {"page": "1"},
"headers": {
"raw_base64": "...",
"parsed": {"Content-Type": "application/json", "Host": "example.com"}
},
"body": {
"raw_base64": "...",
"json": {"name": "John"}
}
}
Response
{
"status_code": 200,
"status_text": "OK",
"headers": {
"raw_base64": "...",
"parsed": {"Content-Type": "application/json"}
},
"body": {
"raw_base64": "...",
"json": {"id": 1}
}
}
Body Parsing
Body is parsed based on Content-Type:
- application/json → body.json
- application/x-www-form-urlencoded → body.form
- multipart/form-data → body.multipart
Raw body is always available as base64 in body.raw_base64.
Options
-r, --response- Parse as HTTP response instead of request
