2.3 wget and curl
wget and curl are two commonly used command-line-based file transfer tools. These two tools are quite similar, yet they have their differences. Both tools can download content via FTP, HTTP, or HTTPS protocols. By using these tools, we can simulate a client sending various TCP requests to a load balancer to study how the load balancer processes data packets and the flow. However, there are differences between the two:
- curl supports more protocols such as FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, and RTSP, while wget only supports FTP, HTTP, HTTPS.
- curl defaults to supporting HTTP1.1 (also supports HTTP1.0), whereas wget only supports HTTP1.0 (it is said that the latest version of wget supports HTTP1.1, which we will validate in subsequent tests).
- There are many articles online stating that the key difference is that curl supports the libcurl library, but wget is purely a command-line tool. This distinction doesnât concern us.
The usage of these command-line tools is very simple, but achieving complete precision in using these commands is not that easy. Letâs start with the simplest commands:
Code Language: javascriptCopy
[root@linux-test ~]# curl http://www.baidu.com <!doctype html>