Repository navigation
curl
GradedJestRisk edited this page Sep 25, 2026
·
4 revisions
2 ways:
- curl configuration file
~/.curlrcfor each call; - environment variable for a single call.
You can disable proxy with --noproxy
curl --noproxy '*' http://www.stackoverflow.com.curlrc
proxy = 1.2.3.4
noproxy = .dev,localhost,127.0.0.1
Send a PUT request (when a GET, omit --request)
curl --request PUT "http://localhost:3001/rnipp/person" To get response code, add --show-headers.
To send a JSON in payload, use --data.
curl \
--header "Content-Type: application/json" \
--request PUT \
--data '{"username":"xyz","password":"xyz"}' \
$URL
In next version, you will use --json to omit --header option.
curl tries any query just one time, but you can ask him to keep trying.
Parameters:
-
retry: how much "times" he should try -
retry-delay: rest time between tries -
retry-max-time: ceiling time
most operations in curl have no time-out by default
Parameters:
-
connect-timeout: to connect -
max-time: to complete (will fail even if query is going on successfully)
https://everything.curl.dev/usingcurl/timeouts.html
Output response code and time elapsed
--write-out "%{http_code} - %{time_total}\n"