Skip to content
shellhacks.dev

Raw HTTP Request Parser

Paste a raw HTTP request or response to see its method, URL, headers and body broken out, and convert the request to curl or JavaScript fetch.

Free · No sign-up · Your inputs stay in your browser

Input

Parse a raw HTTP request or response

Output

Request

MethodPOST
URLhttps://api.example.com/api/v2/orders?dry_run=1
Path/api/v2/orders
Querydry_run=1
VersionHTTP/1.1
Body21 bytes
HeaderValue
Hostapi.example.com
AuthorizationBearer eyJhbGciOiJIUzI1NiJ9.e30.sig
Content-Typeapplication/json
Acceptapplication/json
X-Request-Id7f3c9a

curl

curl -X POST 'https://api.example.com/api/v2/orders?dry_run=1' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.e30.sig' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-Request-Id: 7f3c9a' \ --data-raw '{"sku":"A-1","qty":2}'

fetch

const res = await fetch("https://api.example.com/api/v2/orders?dry_run=1", { method: "POST", headers: { "Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.e30.sig", "Content-Type": "application/json", "Accept": "application/json", "X-Request-Id": "7f3c9a", }, body: "{\"sku\":\"A-1\",\"qty\":2}", });

Headers end at the first blank line and everything after it is the body. Host, Content-Length and Connection are left out of the generated code because curl and fetch set them from the URL and body; a mismatched Content-Length copied by hand is a common source of hanging requests.

Runs in this browser. Nothing you paste is sent to a server.

Where raw requests come from

Burp Suite and ZAP, Wireshark's Follow HTTP Stream, nc and telnet sessions, curl -v output, server logs that capture full requests and API documentation all show HTTP as text. Turning it into a runnable command is the quickest way to reproduce a call. The message format is defined in RFC 9112.

Headers to leave out

Content-Length, Host and Connection are computed by the client from the URL and body. Copying a stale Content-Length by hand is a classic way to make a request hang or be cut short, which is why the generated code omits it.

Share

Frequently asked questions

How do I see the raw request curl sends?
curl -v prints the request line and headers prefixed with >. For the body too, use --trace-ascii -.
Can it parse HTTP/2 requests?
HTTP/2 is binary on the wire, but tools display it in the same text form with pseudo-headers. Remove the lines starting with a colon and the rest parses normally.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Go deeper

Suggested reading

Keep planning

Similar tools