+4 votes
1.3k views
How to run curl command in windows powershell

in Windows 10 by (552k points) | 1.3k views

1 Answer

+5 votes
Best answer

Did you know that it is possible to install cURL in Windows? This open source tool, which allows communication through different protocols from the command line, has been (and is) widely used especially in scripts and programming languages, especially PHP, in different environments and devices. Although it is well known in Linux and Mac OS X environments, it can also be used from Windows.

cURL on Windows

cURL on Windows

To install it you have two options: you use Chocolatey, the package manager for Windows , ( choco install curl ) or from the official page, using the wizard , which may be more comfortable for you.

If you did not know it, I recommend you take a look at the manual that is on the official site  (very retro, right?), Where everything you would be able to do with this little tool is shown. Here are some of the most common examples:

Requests using the different HTTP Verbs

one

curl --request GET http://domain.com/foo/path

one

curl --request POST -u "user:pass" -d "name=gisela&lastname=torres" http://domain.com/api/user

Download a file

one

curl -O www.domain.com/file.txt

If for example you are downloading a file with the previous command and it is too large and a cut occurs, it is possible to use -C - to continue the download where it left off:

one

curl -C - -O www.domain.com/file.txt

Download multiple files

one

curl -O www.domain1.com/file1.txt -O www.domain2.com/file2.txt

Pass basic authentication on a request with cURL

one

curl -u username:password www.domain.com

Download files from an FTP server

one

curl -u ftpuser:ftppass -O ftp://ftp_server/stuff/file.txt

Send an email using the SMTP protocol

one

curl --mail-from [email protected] --mail-rcpt [email protected] smtp://smtpserver.com


by (552k points)

Related questions

+4 votes
1 answer
+5 votes
1 answer
+4 votes
1 answer
asked Sep 19, 2019 in Windows 10 by backtothefuture (552k points) | 342 views
+4 votes
1 answer
+5 votes
1 answer
asked Jul 7, 2020 in Windows 10 by backtothefuture (552k points) | 251 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users