Wednesday, November 26, 2008

PHP curl

'cURL' is the name of the project. The name is a play on "Client for URLs", originally with URL spelled in uppercase, it obvious it deals with URLs. The fact it can also be called 'see URL' also helped, 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:


A free-and-easy-to-use the Client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP. 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!

libcurl is highly portable, it builds and works identically on numerous platforms, including DOS ,Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, AIX, HPUX, IRIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOs, Mac OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare and more.

libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported and fast.


curl is a command line tool for getting or sending files using URL syntax.

Since curl uses libcurl, it supports a range of common Internet protocols, currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DICT, TELNET and FILE.

We pronounce curl and cURL with an initial k sound: [kurl].

Test with the following PHP code:

$url = "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$returned = curl_exec($ch);
curl_close ($ch);
echo $returned;

No comments: