
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/humidity
curl -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
Facing issues? Have Questions? Post them here! I am happy to answer!
- Hide cURL Outputs and Errors on Terminal
- cURL DELETE Request with Examples
- Downloading Google Chrome using cURL Command
- List of 28 Protocols supported by cURL with Examples
- Get the Size of HTTP Response using cURL Command (Content Length)
- How to convert a Postman request to cURL Command
- How to URL Encode Data for a cURL Request Parameters
- Get cURL command from Chrome Inspect Network HTTP URL
- Fetch only content-type using cURL Command
- cURL -d Option with Examples
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- How to get cURL Command to run in verbose mode?
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- Capture cURL Request Output to a File
- List of common cURL Error Codes
- How to pass authorization header using cURL
- Perform Basic Authentication using cURL with Examples
- Trace using cURL Command Example
- Efficient way to perform HTTP cURL GET/POST Requests with Payload
- Save cURL Command Output to a external file
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to follow redirects in cURL Command Request
- List of Online Java compiler with console - Java
- appcompat_v7 errors after updates to API level 21 Material Theme - Android
- Create simple struts2 project using maven commands - Java
- incorrect line ending: found carriage return (\r) without corresponding newline (\n) - Android
- Switch between Python 2.x 3.x versions in Mac Terminal - MacOS
- Fix zsh: permission denied: script.sh - zsh
- Java 8: Convert Iterator to Stream Examples - Java
- How to save a file in Nano Editor and Exit - Linux