Wednesday, February 17, 2010

wget or curl

This is not a comparison between the two tools but rather how to get them working the same way when requesting for example Web Services.

So here we are trying to test our super cool and light  JSON Service from the command prompt and curl comes to our rescue:
$ curl
Wget will need a couple of switches to provide the same output (for more info: wget --help):
$ wget -q -O -
Let's say you want to download a file. With wget you go this way:
wget -o
With curl you go with the below. Note the -L switch to make sure curl follows redirections:
curl -L -o logo4w.png

No comments: