0x00040x04
$ xxd dev.lwlx.xyz/blog/basic-cURL-cheatsheet-lwlx← indexgithub ↗twitter ↗
000000000000000000100010000000200020000000300030000000400040
0x04cheatsheetlwlx · @0x0000005cheatsheet / commandline / curl

the cURL cheat sheet

fig.0
// contents · 01 curl what is it?

01cURL What is it?

cURL describes itself as:

command line tool and library for transferring data with URLs

cURL is a multipurpose networking tool which has lots of useful usecases.

02cheat sheet

Command Description
curl http://lwlx.xyz GET request with cURL
curl http://lwlx.xyz -v Verbose GET request with cURL
curl http://admin:[email protected]/ -vvv cURL Basic Auth login
curl -u admin:password http://lwlx.xyz/ -vvv Alternate cURL Basic Auth login
curl -u admin:password -L http://lwlx.xyz/ cURL Basic Auth login, follow redirection
curl -u admin:password 'http://lwlx.xyz/search.php?port_code=us' cURL GET request with parameter
curl -d 'username=user&password=pass' -L http://lwlx.xyz/login.php POST request with cURL
curl -d 'username=user&password=pass' -L http://lwlx.xyz/login.php -v Debugging with cURL
curl -d 'username=user&password=pass' -L --cookie-jar /dev/null http://lwlx.xyz/login.php -v Cookie usage with cURL
curl -d 'username=user&password=pass' -L --cookie-jar cookies.txt http://lwlx.xyz/login.php cURL with cookie file
curl -H 'Content-Type: application/json' -d '{ "username" : "user", "password" : "pass" }' cURL specify content type
curl -X OPTIONS http://lwlx.xyz/ -vv cURL OPTIONS request
curl -X PUT -d @test.txt http://lwlx.xyz/test.txt -vv File upload with cURL
curl -X DELETE http://lwlx.xyz/test.txt -vv DELETE method with cURL