Getting Started

SSL

    --cacert <file>
    --capath <dir>
-E, --cert <cert> # --cert: client certificate file
    --cert-type # der/pem/eng
-k, --insecure # For self-signed certificates

#Install

apk add --update curl # install in alpine linux

Header information Headers

-A <str>      # --user-agent
-b name=val   # --cookie
-b FILE       # --cookie
-H "X-Foo: y" # --header
--compressed  # use deflate/gzip

data

# --data: HTTP post data
# URL encoding (eg, status="Hello")
-d 'data'
# --data pass file
-d @file
# --get: send -d data via get
-G

Request

-X POST # --request
-L # If the page redirects, follow the link
-F # --form: HTTP POST data for multipart/form-data

Options

-o <file>    # --output: write to file
-u user:pass # --user: authentication

-v   # --verbose: Make curl verbose during operation
-vv  # more verbose
-s   # --silent: don't show progress meter or errors
-S   # --show-error: When used with --silent (-sS), show errors but no progress meter

-i  # --include: include HTTP headers in the output
-I  # --head: header only

Introduction

Curl is a tool for transferring data between servers, supporting protocols, including:

  • HTTP
  • HTTPS
  • FTP
  • IMAP
  • LDAP
  • POP3
  • SCP
  • SFTP
  • SMB
  • SMTP

* etc…

Comments