Turning Captured Browser Traffic Into Clean cURL Snippets
Reproducing an API bug often comes down to pasting a single working curl invocation into a GitHub issue or running it against staging. Manually copying headers out of a multi-megabyte .har file is error-prone—HTTP/2 pseudo-headers (:method, :authority) break standard cURL, and forgetting to strip Cookie or Authorization leaks live user sessions in public tickets.
This local converter parses the capture inside browser RAM, strips HTTP/2 pseudo-headers plus calculated Host/Content-Length headers, builds a POSIX-quoted curl -X ... -H ... --data-raw ... snippet for each entry, and leaves secret redaction enabled by default until you explicitly toggle it off for private terminal replay.
Workflow & Workstation Script Alternative
- Drop a
.harfile above or click Try sample .har (with mock secrets). - Click Inspect on any request row to preview its full formatted command above the table, then click Copy Selected cURL.
- Only uncheck Redact secrets & session cookies if you need real local credentials to replay a request strictly on your own machine—never paste unredacted commands into issue trackers.
# Quick jq snippet to inspect request method, URL, and status from a HAR file locally
jq -r '.log.entries[] | "\(.request.method) \(.response.status) \(.request.url)"' capture.harSecurity & Shell Quoting Guarantees
- Zero command injection when pasting: Every single quote inside request bodies or query strings is escaped via
'\''inside single-quoted shell tokens so subshell syntax like$(...)cannot execute when pasted into bash or zsh. - Form-encoded bodies: Requests captured with structured
postData.paramsare re-assembled cleanly as URL-encoded--data-rawpayloads when raw text is absent.
Frequently Asked Questions
Does the generated cURL strip HTTP/2 pseudo-headers like :method and :authority?
Yes. Browser DevTools exports Chrome/Edge HTTP/2 pseudo-headers such as :method, :path, :scheme, and :authority plus Host and Content-Length headers that cause curl errors; this converter omits them cleanly.
Are shell special characters like single quotes or $(...) safely escaped?
Yes. Every URL, header pair, and --data-raw payload is single-quoted with POSIX shell escaping so pasting a snippet into bash or zsh cannot trigger accidental command substitution.
Can I keep real headers when replaying locally on my own terminal?
Yes. Automatic secret redaction starts ON so nothing leaks if you copy into Slack or Jira, and you can uncheck "Redact secrets & session cookies" whenever generating a private cURL strictly for local reproduction.