
cURL supports an extensive list of Protocols,
Let's take a look at some of the examples with each one of them,
- DICT
- FILE
- FTP
- FTPS
- GOPHER
- GOPHERS
- HTTP
- HTTPS
- IMAP
- IMAPS
- LDAP
- LDAPS
- MQTT
- POP3
- POP3S
- RTMP
- RTMPS
- RTSP
- SCP
- SFTP
- SMB
- SMBS
- SMTP
- SMTPS
- TELNET
- TFTP
- WS
- WSS
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 <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]
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% curl file:///Users/code2care/Desktop/file.html
Hello World!
Example: FILE Protocol on Windows
> curl file://c:/users/code2care/desktop/file.html
Hello World!
The File Transfer Protocol, to download and upload files on an FTP Server,
Example:$ curl ftp://ftp.code2care.org/2023/
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 is a distributing, searching, and retrieving documents over the Internet Protocol.
Example:$ curl gopher://gopher.code2care.org
GOPHERS is a secured Gopher using TLS.
Example:$ curl gophers://gophers.code2care.org
HTTP is what we are all familiar with: Hypertext Transfer Protocol,
Example:$ curl http://code2care.org
HTTPS is secured HTTP using SSL/TLS,
Example:$ curl https://code2care.org
IMAP: Internet Message Access Protocol is used for reading email.
Example:$ curl imap://imap.code2care.org/mail-server -u user:password
IMAPS is secured IMAP using SSL/TLS.
Example:$ curl imaps://imaps.code2care.org/mail-server -u user:password
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 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: Message Queuing Telemetry Transport is a pub-sub-based protocol, widely used in IoT systems.
$ curl mqtt://cod2care.org/sensor/humidity
Publish Example:
curl -d 22 mqtt://codde2care.org/sensor/status
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 is secured using SSL/TLS.
Example:$ curl pop3s://mail.code2care.org
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 is secured using SSL/TLS.
Example:$ curl rtmps://rtmps.code2care.org/video/visuals.mp4
RTSP: Real Time Streaming Protocol is a network protocol for controlling streaming media servers.
Example:$ curl rtsp://rtsp.code2care.org/video/apple.mp4
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: 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: 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
Secured SMB using SSL/TLS.
Example:$ curl -u "code2care\user:password" smbs://2023/JAN/01
SMTP: Simple Mail Transfer Protocol is used for email transmission.
Example:$ curl sftp://sftp.code2care.org/2023_file.txt -u user
It is a secured SMTP using SSL/TLS.
Example:$ curl sftps://sftps.code2care.org/2023_file.txt -u user
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: 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:$ curl -O tftp://code2care-server/conf.txt
Upload Example:
$ curl -T conf.txt tftp://cod2care-server/
WS: WebSocket is a bidirectional TCP-like protocol over an HTTP request.
Example:$ curl ws://code2care.org
WS: WebSocket is a bidirectional TCP-like protocol over an HTTP request.
Example:$ curl wss://code2care.org
Have Questions? Post them here!
- cURL Example using IP (IPv4 and IPv6) address and Port
- Efficient way to perform HTTP cURL GET/POST Requests with Payload
- Save cURL Command Output to a external file
- How to set Connection and Max Timeout for cURL Request with Examples
- [fix] command not found curl
- Fetch only content-type using cURL Command
- Trace using cURL Command Example
- Hide cURL Outputs and Errors on Terminal
- cURL Option to show HTTP Response Status Code
- Downloading Google Chrome using cURL Command
- Perform Basic Authentication using cURL with Examples
- List of 28 Protocols supported by cURL with Examples
- URL Encode cURL HTTP GET\POST Data with Examples
- Get the Size of HTTP Response using cURL Command (Content Length)
- How to get cURL Command to run in verbose mode?
- Get cURL command from Chrome Inspect Network HTTP URL
- Check help on commands while being on sftp> prompt - FTP
- How to install npm on Ubuntu - Linux
- How to install Zoom Add-in to Outlook (Mac) - MacOS
- How to update SharePoint List Item programmatically using C#.Net - SharePoint
- Set Python 3.8 as a default python version on macOS - MacOS
- Setting $JAVA_HOME Environment Variable in macOS - MacOS
- JSON Schema Validator Libraries: JSON Tutorial - Json-Tutorial
- Top 3 Awesome Text Editors developers prefer at workplace - Sublime