what is curl? How to use curl in windows

What is curl?

cURL is the name of the project. The name is a play on ‘Client for URLs’.

 It works as an abbreviation for “Client URL Request Library” or why not the recursive version: “Curl URL Request Library”.

The cURL project produces two products:

libcurl

A free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP.

libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and more!

curl

A command line tool for getting or sending files using URL syntax.

###################################################################

While i am learning nodejs, i use to see in tutorials where programmers execute their code and calling up in curl.

I couldnt understand what it is initially

Now i will explain in simple words..

Once after executing server.js file in node, i need to open up a browser and write localhost:8080 to see the output.Like shown below..

26-05-2014 12-28-29

26-05-2014 12-29-24

Now instead of opening up my browser, i would like to see the same result in windows command prompt. For this we can achieve through this curl. This what  i understood, i donno the other purpose of curl 😉

Now you can see the same result in command prompt below

26-05-2014 12-48-04

How to install curl?

1st method:

If you are not into cygwin, you can use native windows builds, some are here: http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000%2FXP

from above url you can download curl msi file and install it and can call up anywhere in cmd.

2nd method:

You can just download the curl executable, for example for Windows 64bit. You can download it fromhere and then you just can save the curl.exe file on your C: drive.

To use it, just open the command prompt and type in:

C:\curl http://someurl.com

For 2nd method you should go to C:/ where your curl is located and then call up in command prompt like shown in above image.

For 1st method, you can install and call curl anywhere.

For options in curl: try “curl –help” which lists out all options that can be used for curl.

Good luck 🙂

References:

http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request

http://curl.haxx.se/docs/manual.html

http://curl.haxx.se/docs/httpscripting.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s