Send a GET request and print the response body
curl https://api.example.com/usersCommon parameter combos for HTTP requests, auth, debugging and resumable downloads in curl.
Send a GET request and print the response body
curl https://api.example.com/usersSilent mode that still prints errors, suitable for scripts
curl -sS https://api.example.com/healthPrint response headers together with the body
curl -i https://api.example.com/usersFetch headers only to check availability quickly
curl -I https://example.comPrint only the status code for script checks
curl -s -o /dev/null -w "%{http_code}\n" https://example.comSend a POST request with a JSON body
curl -X POST https://api.example.com/users -H "Content-Type: application/json" -d '{"name":"Tom"}'Read the body from a file and replace the resource
curl -X PUT https://api.example.com/users/42 -H "Content-Type: application/json" -d @payload.jsonPartially update resource fields
curl -X PATCH https://api.example.com/users/42 -d '{"active":false}'Delete the specified resource
curl -X DELETE https://api.example.com/users/42Send GET query params encoded automatically
curl -G --data-urlencode "q=Vue 3" --data-urlencode "page=2" https://api.example.com/searchUpload a file as multipart form data
curl -F "file=@./avatar.png" -F "name=Tom" https://api.example.com/uploadAccess an endpoint with Basic authentication
curl -u admin:secret https://api.example.com/basicAccess a protected endpoint with a Bearer token
curl -H "Authorization: Bearer <TOKEN>" https://api.example.com/mePass an API key through a custom header
curl -H "X-API-Key: <API_KEY>" https://api.example.com/dataLog in and save response cookies to a file
curl -c cookies.txt -d "user=tom&pass=123" https://example.com/loginReuse saved cookies to keep the session
curl -b cookies.txt https://example.com/profilePrint the full request and response for troubleshooting
curl -v https://api.example.com/usersBypass DNS and point the domain at a local host
curl --resolve api.example.com:443:127.0.0.1 https://api.example.com/healthSend the request through a proxy
curl -x http://127.0.0.1:7890 https://example.comLimit connect and total time so requests never hang
curl --connect-timeout 2 --max-time 5 https://example.comPrint the status code and total request time
curl -s -o /dev/null -w "状态:%{http_code} 耗时:%{time_total}s\n" https://example.comSkip certificate verification for self-signed testing only
curl -k https://self-signed.example.comDisabling verification removes MITM protection; never use in production
Follow redirects and save with the remote file name
curl -L -O https://example.com/files/app.tar.gzSave with a custom name when the URL has query params
curl -L -o app.tar.gz "https://example.com/download?id=42"Resume an interrupted download from where it stopped
curl -C - -O https://example.com/files/big.isoLimit download speed to avoid saturating bandwidth
curl --limit-rate 500k -O https://example.com/files/big.isoRun a remote script directly; risky if the source is untrusted
curl -sL https://example.com/install.sh | bashDownload and review the script before executing it
This website uses cookies to ensure you get the best experience on our website. Privacy Policy.