curl command cheat sheet

In this tutorial, I have compiled a comprehensive curl command cheat sheet. Curl is a powerful command-line tool for making HTTP requests and working with various protocols. The cheat sheet is designed to serve as a quick reference guide, providing concise and organized information on the essential curl commands. Whether you're a beginner or an experienced user, this resource aims to simplify the usage of curl commands, helping you navigate and leverage its capabilities efficiently. Feel free to explore the cheat sheet and enhance your proficiency in utilizing curl for various web-related tasks.

curl command cheat sheet


-o <file>       # --output: write to file
-u user:pass  # --user: Authentication
-v                  # --verbose
-s                  # --silent
-I                  # --head: headers only
-i                  # --include: Include the HTTP-header in the output

-X POST          # --request
-L                     # follow link if page redirects
-F                     # --form: HTTP POST data for multipart/form-data
-A <str>            # --user-agent
-b name=val      # --cookie
-b FILE             # --cookie
-H "X-Foo: y"    # --header
--compressed     # use deflate/gzip
-d 'data'      # --data: HTTP post data, URL encoded (eg, status="Hello")
-d @file     # --data via file
-G              # --get: send -d data via get
-E, --cert <cert>     # --cert: Client cert file
    --cert-type          # der/pem/eng
-k, --insecure          # for self-signed certs

Curl command examples

curl Get/Head

#Curl head request
curl -I
#Curl head request with verbose
curl -v -I
#Curl get response with headers
curl -k -v
CURL command POST
#Curl post request
curl -d "name=username&password=1111111111" <URL>
#Curl post send json
curl <URL> -H "content-type: application/json" -d "{ \"woof\": \"bark\"}"


#Get my public ip
curl -L -s
curl -L -s
#Curl upload
curl -v -F key1=value1 -F upload=@localfilename <URL>
#Curl with http2
curl -k -v --http2
#Curl ftp upload
curl -T -u test:test
#Curl ftp download
curl -u test:test -o


The provided resources, including the "curl command cheat sheet" and the examples demonstrating "Curl command POST" and "Curl command ADVANCED," offer valuable insights into harnessing the capabilities of the curl command-line tool. The cheat sheet serves as a handy reference guide, condensing essential information for quick and efficient usage. The diverse examples showcase the versatility of curl, from basic GET requests to advanced scenarios like POST requests and customization options. Whether you're a beginner seeking fundamental understanding or an advanced user exploring intricate functionalities, these resources collectively empower you to navigate and leverage curl effectively in various web-related tasks.


Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6