Command-line Curl in Windows

In looking for a simple way to get results from a url in windows, I came across a very convenient powershell method. This is the way to go if making command line http requests is rare, and/or installing software on the box is undesired.

powershell -Command "(new-object net.webclient).DownloadString('http://example.com')"

which, while a bit wordy, is similar to typing

curl http://example.com/

in a more Unix-ish environment.

More information about net.webclient is available here: WebClient Methods (System.Net)


If installing software is not an issue, then curl itself can be installed. Windows 32 and 64-bit downloads are available curl.haxx.se: cURL - Download.


Apparently, Git for Windows has GNU bash built in, which I guess has curl built into it. Haven’t tried this.

See Git - Downloads.

UPDATE: I’ve tried this and I’m quite happy with it. I also just came across [cmder Console Emulator](http://cmder.net/), which is based on conemu, which I’ve also intended to test out some day. I haven’t tried this yet.

See also: