Commonly used for transferring data over multiple protocols like HTTPS, FTP, LDAP, etc., curl is particularly useful for debugging and troubleshooting connectivity and endpoint-related issues in environments and use-cases that lack proper tooling.


GET, POST, PUT, DELETESpecify the request type. Default GET
-vNAEnable verbose logging
NADisable Certificate checking (SSL/TLS disable)
NASpecify output file to which response is written
NARequest body for POST request
-CNAResume interrupted downloads
-LNAFollow redirects
-u <USER_NAME>:<PASSWORD>NABasic authentication
--header '<HEADER_VALUE>'
NAProvide header value REST request
-b <DATA>
--cookie "name1:value1; name2: value2"
NASpecify cookie headers
--basicNAExplicitly specify authentication type
--negotiateNASpecify kerberos authentication type
--http1.0NAForce to use http 1.0
--http1.1NAForce to use http 1.1
--http2NAForce to use http 2.0
--progress-barNAShows transfer progress bar

Packages and Install

Quick installation of the curl utility on different operating systems.

OSPackage Install CMD
Debian/Ubuntuapt install curl -y
CentOS/Fedora(DNF, MicroDNF, RPM)rpm install curl
dnf install curl
Arch (Pacman)pacman -Sy curl
Alpine (APK-Docker)apk –no-cache add curl


  • Download a image file
curl -o logo.png
  • Sending a custom header to the request
curl --header 'Host:'
  • Make a GET request with basic authentication.
curl -u user_name:password -X GET https//
  • Make a POST request with JWT authentication, skip HTTPS check, and provide JSON data.
curl -k -X POST https://localhost:8088/endpoint \
-H 'Accept: application/json' \
-H "Authorization: Bearer ${TOKEN}" \
--data '{"name": "John"}'
  • Make a REST request with Kerberos-enabled authentication, skip TLS, and enable verbose logging.
# Fetch the TGT token for kerberos principal
klist -kt /etc/krb5.keytab
kinit -kt /etc/krb5.keytab <PRINCIPAL>

# Send the SPNEGO enabled request using the earlier fetched token
curl -kv --negotiate -u : <URL>
  • Download a file with progress.
curl --progress-bar -O https://localhost:8080/wp-content/
  • Send a request using cookies.
curl -b "sessionid=123456" https://localhost:8080