cURL → PowerShell / wget Converter
Converts cURL commands into PowerShell Invoke-RestMethod, Invoke-WebRequest or wget, preserving method, headers, body, auth and redirects.
Line continuations with \ or ^ are accepted, and so is the curl.exe prefix.
Summary
- Method
- —
- URL
- —
- Headers
- —
- Body
- —
Ignored flags
—
How the flags map
| cURL | PowerShell | wget |
|---|---|---|
| -X POST | -Method POST | --method=POST |
| -H "K: V" | -Headers $headers | --header='K: V' |
| -d body | -Body $body | --body-data='body' |
| -u u:p | Authorization: Basic | --user / --password |
| -k | -SkipCertificateCheck | --no-check-certificate |
| -L | -MaximumRedirection 5 | default |
| -o file | -OutFile "file" | -O 'file' |
| --max-time 30 | -TimeoutSec 30 | --timeout=30 |
Everything runs in your browser: the command, the tokens, the credentials in -u. Basic auth is encoded to base64 locally, which is encoding and not encryption — anyone with the header can read the password back.
The same request, now in PowerShell
The API docs give the example in cURL, you are on Windows and you paste it into PowerShell expecting it to run. It does not: there curl is an alias for Invoke-WebRequest, which knows neither -H nor -d and answers with a parameter error. Paste the command here and it comes back as Invoke-RestMethod, Invoke-WebRequest or wget, with method, headers, body and auth in place.
The parser honours single and double quotes, line continuation with the bash backslash and the cmd caret, and recognises the options that actually show up in API snippets: -X, repeated -H, every flavour of -d, --data-urlencode, --json, -F, -u, -b, -A, -L, -k, -o, --max-time and -G. With -G the body becomes a query string on the URL, just as cURL would do.
Headers come out in their own hashtable, and the splatting checkbox swaps the one-line call for a parameter block that reads better once a request carries six options. Note that -k maps to -SkipCertificateCheck, which only exists from PowerShell 6 on, and that -u is base64 encoded in your browser: base64 is encoding, not encryption, so treat the generated command as a secret.
Frequently asked questions
Why does pasting cURL straight into PowerShell fail?
Does the password from -u leave my computer?
Should I use Invoke-RestMethod or Invoke-WebRequest?
Related Tools
cURL to fetch()
Paste a cURL command and generate the JavaScript fetch() equivalent. Supports -X, -H, -d, --data-raw, querystring and cookies. Everything in your browser.
Horsepower to Watts Converter
Convert metric horsepower (PS) to watts instantly (1 PS = 735.5 W). Useful for comparing the power output of cars, motorcycles and machinery.
Gwei to ETH Converter
Convert values between gwei and ETH, the units of Ethereum. Essential for calculating gas fees and working with transactions on the ETH network.