curl
Windows CMD · Network · reference only
What it does
Transfers data to or from a server by URL (HTTP, HTTPS, FTP...). It ships with Windows 10 and 11 as curl.exe.
Syntax
curl [opciones] URL
Options and parameters
-o ficheroSaves the response to that file instead of showing it.
-OSaves the response with the name it has on the server.
-LFollows redirects.
-IRequests only the response headers.
-X métodoUses that HTTP method, such as POST or DELETE.
-H "cabecera"Adds a header to the request.
-d datosSends that data in the body of a POST request.
Usage examples
curl https://example.comShows the page's code on screen.
curl -I https://example.comShows only the headers: status code, content type...
curl -L -o pagina.html https://example.comDownloads the page following redirects and saves it as pagina.html.
curl -X POST -d "usuario=ana" https://example.com/loginSubmits a form by POST.
Notes and common mistakes
- In PowerShell, curl is an alias for Invoke-WebRequest: type curl.exe to use the real tool.
- In CMD, use double quotes for arguments with spaces.