Short for Client URL and is a command-line tool used for transferring data to or from a server using various protocols.

HTTP Requests

PurposeCommand
Basic GET requestcurl websitename.com
Download filecurl websitename.com/file.html
HTTPS certificate validationcurl -k https://websitename.com
Print full HTTP request/responsecurl websitename.com -v
Send HEAD request (only headers)curl -I https://websitename.com
Print response headers and bodycurl -i https://websitename.com
Set User-Agent headercurl websitename.com -A 'Mozilla/5.0'
HTTP basic auth (in URL)curl http://username:password@websitename.com/
HTTP basic auth (separate credentials)curl -u username:password http://websitename.com/
Set custom request headercurl -H 'Authorization: Bearer token123' websitename.com
Send GET request with parameterscurl 'websitename.com/search?query=example'
Send POST request with form datacurl -X POST -d 'username=admin&password=pass'
websitename.com/login
Send POST request with JSON datacurl -X POST -d '{"username":"admin"}' -H
'Content-Type: application/json' websitename.com/api
Set request cookiescurl -b 'session=abc123' websitename.com