curl / Documentation / Headers to curl

h2c - headers to curl

Paste the HTTP request into the text field and get the correspending curl command line for generating such a request.

use short command line options
enable verbose output
allow curl's default headers
insist on same HTTP version

Command:

curl --header Accept: --header "Content-Type: application/json" --cookie "a=12; b=23" --header "Shoesize: 12" --user-agent "moo" --data-binary "{\"I do not speak\": \"json\"} {\"I do not write it\": \"either\"}" https://example.com/test/site/post.cgi

Documentation links for used options

The generated command line assumes a HTTPS site and generates such a URL. There is typically nothing in the request that tells if HTTPS or HTTP was used.

If you submit an illegally formatted HTTP request, chances are the shown curl command line might not reproduce it perfectly. curl is primarily made to generate fine HTTP.

Use this with curl!

Save the HTTP request you want to send in a local file, then send it here like this:

curl --data-urlencode http@file https://curl.se/h2c/

... and you'll get a curl command line in response.

Privacy

All data you submit to this web service will be crunched and converted on the curl server. To keep your HTTP requests private, download h2c and run it yourself locally.


h2c on github