
cURL supports an extensive list of Protocols,
Let's take a look at some of the examples with each one of them,
- DICT
Using DICT protocol you fetch definitions and details of words using online dictionaries.
Example:$ curl dict://dict.org/d:soccer 220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <auth.mime> <156867369.27138.1670825746@dict.dict.org> 250 ok 150 1 definitions retrieved 151 "soccer" wn "WordNet (r) 3.0 (2006)" soccer n 1: a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal [syn: {soccer}, {association football}] . 250 ok [d/m/c = 1/0/32; 0.000r 0.000u 0.000s] 221 bye [d/m/c = 0/0/0; 0.000r 0.000u 0.000s] - FILE
Using the FILE protocol with cURL, you can get a file from your local system. Note this is not a network protocol.
Example: FILE Protocol on macOS/Linux
Example: FILE Protocol on Windows% curl file:///Users/code2care/Desktop/file.html Hello World!> curl file://c:/users/code2care/desktop/file.html Hello World! - FTP
The File Transfer Protocol, to download and upload files on an FTP Server,
Example:$ curl ftp://ftp.code2care.org/2023/ - FTPS
FTPS Protocol is an extension to the File Transfer Protocol (FTP), it adds support for the Transport Layer Security (TLS)
Example:$ curl ftps://ftps.code2care.org/2023/ - GOPHER
GOPHER is a distributing, searching, and retrieving documents over the Internet Protocol.
Example:$ curl gopher://gopher.code2care.org - GOPHERS
GOPHERS is a secured Gopher using TLS.
Example:$ curl gophers://gophers.code2care.org - HTTP
HTTP is what we are all familiar with: Hypertext Transfer Protocol,
Example:$ curl http://code2care.org - HTTPS
HTTPS is secured HTTP using SSL/TLS,
Example:$ curl https://code2care.org - IMAP
IMAP: Internet Message Access Protocol is used for reading email.
Example:$ curl imap://imap.code2care.org/mail-server -u user:password - IMAPS
IMAPS is secured IMAP using SSL/TLS.
Example:$ curl imaps://imaps.code2care.org/mail-server -u user:password - LDAP
LDAP is a Lightweight Directory Access Protocol used for accessing and maintaining distributed directory information.
Example:curl "ldap://ldap.code2care.org:1200/dc=code2care,dc=org?dir?sub?cn=code2care" -u "cn=admin" Enter host password for user 'cn=admin': DN: uid=code2careorg,ou=People,dc=code2care,dc=org homephone: +1 XX XX XXXX - LDAPS
LDAPS is secured LDAP using SSL/TLS.
Example:curl "ldaps://ldaps.code2care.org:1200/dc=code2care,dc=org?dir?sub?cn=code2care" -u "cn=admin" Enter host password for user 'cn=admin': DN: uid=code2careorg,ou=People,dc=code2care,dc=org homephone: +1 XX XX XXXX - MQTT
MQTT: Message Queuing Telemetry Transport is a pub-sub-based protocol, widely used in IoT systems.
Publish Example:$ curl mqtt://cod2care.org/sensor/humiditycurl -d 22 mqtt://codde2care.org/sensor/status - POP3
POP3: Post Office Protocol version 3 is a protocol that is used for retrieving email from a mail server.
Example:$ curl pop3://mail.code2care.org - POP3S
POP3S is secured using SSL/TLS.
Example:$ curl pop3s://mail.code2care.org - RTMP
RTMP: Real-Time Messaging Protocol is a protocol used for streaming audio, video, and data.
Example:$ curl rtmp://rtmp.code2care.org/video/sample.mp4 - RTMPS
RTMPS is secured using SSL/TLS.
Example:$ curl rtmps://rtmps.code2care.org/video/visuals.mp4 - RTSP
RTSP: Real Time Streaming Protocol is a network protocol for controlling streaming media servers.
Example:$ curl rtsp://rtsp.code2care.org/video/apple.mp4 - SCP
SCP: Secure Copy protocol is used to copy files to and from a remote SSH server.
Example:$ curl scp://scp.code2care.org/2023.csv -u user - SFTP
SFTP: SSH File Transfer Protocol is used to access, transfer, manage remote files over a reliable data stream.
Example:$ curl sftp://sftp.code2care.org/2023.csv -u user - SMB
SMB: Server Message Block protocol an application-layer network protocol used for providing shared access to files, printers, and serial ports.
Example:$ curl -u "code2care\user:password" smb://2023/JAN/01 - SMBS
Secured SMB using SSL/TLS.
Example:$ curl -u "code2care\user:password" smbs://2023/JAN/01 - SMTP
SMTP: Simple Mail Transfer Protocol is used for email transmission.
Example:$ curl sftp://sftp.code2care.org/2023_file.txt -u user - SMTPS
It is a secured SMTP using SSL/TLS.
Example:$ curl sftps://sftps.code2care.org/2023_file.txt -u user - TELNET
TELNET is an Application Layer Protocol. It is used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection.
Example:$ curl telnet://code2care.org - TFTP
TFTP: Trivial File Transfer Protocol is used for file transfers over UDP to get a file from or put a file onto a remote host
Download Example:
Upload Example:$ curl -O tftp://code2care-server/conf.txt$ curl -T conf.txt tftp://cod2care-server/ - WS
WS: WebSocket is a bidirectional TCP-like protocol over an HTTP request.
Example:$ curl ws://code2care.org - WSS
WS: WebSocket is a bidirectional TCP-like protocol over an HTTP request.
Example:$ curl wss://code2care.org
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!