Skip to main content

curl

Tool for making network requests to servers. This is typically installed on macs.

man curl

Quick References

Making a request is as simple as the following

curl <URL>

Favorite Options

FlagDescriptionExample
-iReturns header and body responsecurl -i https://example.com
-IReturns header response onlycurl -I https://example.com
-HAdd a header to the requestcurl -H 'X-Sample-Header: Test' https://example.com
-XDefine request methodcurl -X POST https://example.com
-DHTTP Post datacurl -X POST https://example.com -D "{'hello': 'world'}"
-VVerbose mode, get more details on the requestcurl -V https://example.com
-sSilent mode, reduces output datacurl -s https://example.com
-ODownload the response to a file insteadcurl -O https://example.com/file.txt
-kInsecure, useful for when trying to test a request with an expired certcurl -k https://example.com
-DOutput headers to filecurl -D headers.txt https://example.com