List of 28 Protocols supported by cURL with Examples


cURL Protocols with Examples

cURL supports an extensive list of Protocols,

Let's take a look at some of the examples with each one of them,

  1. DICT
  2. 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]
    

  3. FILE
  4. 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!

  5. FTP
  6. The File Transfer Protocol, to download and upload files on an FTP Server,

    Example:
    $ curl ftp://ftp.code2care.org/2023/

  7. FTPS
  8. 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/

  9. GOPHER
  10. GOPHER is a distributing, searching, and retrieving documents over the Internet Protocol.

    Example:
    $ curl gopher://gopher.code2care.org

  11. GOPHERS
  12. GOPHERS is a secured Gopher using TLS.

    Example:
    $ curl gophers://gophers.code2care.org

  13. HTTP
  14. HTTP is what we are all familiar with: Hypertext Transfer Protocol,

    Example:
    $ curl http://code2care.org

  15. HTTPS
  16. HTTPS is secured HTTP using SSL/TLS,

    Example:
    $ curl https://code2care.org

  17. IMAP
  18. IMAP: Internet Message Access Protocol is used for reading email.

    Example:
    $ curl imap://imap.code2care.org/mail-server -u user:password

  19. IMAPS
  20. IMAPS is secured IMAP using SSL/TLS.

    Example:
    $ curl imaps://imaps.code2care.org/mail-server -u user:password

  21. LDAP
  22. 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

  23. LDAPS
  24. 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

  25. MQTT
  26. 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

  27. POP3
  28. 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

  29. POP3S
  30. POP3S is secured using SSL/TLS.

    Example:
    $ curl pop3s://mail.code2care.org

  31. RTMP
  32. RTMP: Real-Time Messaging Protocol is a protocol used for streaming audio, video, and data.

    Example:
    $ curl rtmp://rtmp.code2care.org/video/sample.mp4

  33. RTMPS
  34. RTMPS is secured using SSL/TLS.

    Example:
    $ curl rtmps://rtmps.code2care.org/video/visuals.mp4

  35. RTSP
  36. RTSP: Real Time Streaming Protocol is a network protocol for controlling streaming media servers.

    Example:
    $ curl rtsp://rtsp.code2care.org/video/apple.mp4

  37. SCP
  38. 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

  39. SFTP
  40. 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

  41. SMB
  42. 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

  43. SMBS
  44. Secured SMB using SSL/TLS.

    Example:
    $ curl -u "code2care\user:password" smbs://2023/JAN/01

  45. SMTP
  46. SMTP: Simple Mail Transfer Protocol is used for email transmission.

    Example:
    $ curl sftp://sftp.code2care.org/2023_file.txt -u user

  47. SMTPS
  48. It is a secured SMTP using SSL/TLS.

    Example:
    $ curl sftps://sftps.code2care.org/2023_file.txt -u user

  49. TELNET
  50. 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

  51. TFTP
  52. 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/

  53. WS
  54. WS: WebSocket is a bidirectional TCP-like protocol over an HTTP request.

    Example:
    $ curl ws://code2care.org

  55. WSS
  56. 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!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap