TOOL » LINUX » PACKAGE

Curl

Usage

shell
curl OPTIONS URL
OptionDescription
-v --verboseMakes curl verbose during the operation.
-X --requestSpecifies a custom request method (GET, HEAD, POST, PUT).
-H --headerExtra header to include in the request when sending HTTP to a server.
-d --dataSends the specified data to the HTTP server.
-s --silentSilent (Does not show progress bar).
-o --outputWrite response into file.
-L --locationFollow redirect.
-k --insecureSkip SSL certificate check.
--noproxyComma-separated list of hosts which do not use a proxy, if one is specified.

Download file from remote

shell
curl "https://img.shields.io/badge/pylint-10-green.svg"
curl -o pylint.svg "https://img.shields.io/badge/pylint-10-green.svg"
curl -o nvim.appimage -L https://github.com/neovim/neovim/releases/download/v0.4.2/nvim.appimage

Put request

shell
curl -X PUT \
  -H 'Content-Type:application/json' \
  -d '{"json":1,"encoded":{"key":"value"}}' \
  http://mysite.com

Useful services

CommandService
curl ifconfig.mePublic IP address
curl ja.wttr.inWeather forecast (in japanese)