WEB REQUESTS
CHEAT SHEET
cURL
Command Description
curl -h cURL help menu
curl [Link] Basic GET request
curl -s -O [Link]/[Link] Download file
curl -k [Link] Skip HTTPS (SSL)
certificate validation
curl [Link] -v Print full HTTP
request/response details
curl -I [Link] Send HEAD request
(only prints response
headers)
curl -i [Link] Print response headers
and response body
curl [Link] -A 'Mozilla/5.0' Set User-Agent header
curl -u admin:admin [Link] Set HTTP basic
authorization credentials
curl [Link] Pass HTTP basic
authorization credentials
in the URL
Command Description
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' Set request header
[Link]
curl '[Link] Pass GET parameters
search=le'
curl -X POST -d 'username=admin&password=admin' Send POST request with
[Link] POST data
curl -b 'PHPSESSID=c1nsa6op7vtk7kdis7bcnbadf1' Set request cookies
[Link]
curl -X POST -d '{"search":"london"}' -H 'Content- Send POST request with
Type: application/json' [Link] JSON data
<PORT>/[Link]
APIs
Command Description
curl [Link] Read entry
curl -s [Link] | jq Read all
entries
curl -X POST [Link] -d Create
'{"city_name":"HTB_City", "country_name":"HTB"}' -H 'Content- (add) entry
Type: application/json'
curl -X PUT [Link] -d Update
'{"city_name":"New_HTB_City", "country_name":"HTB"}' -H (modify)
'Content-Type: application/json' entry
curl -X DELETE [Link] Delete entry
<PORT>/[Link]/city/New_HTB_City
Browser DevTools
Shortcut Description
Shortcut Description
[CTRL+SHIFT+I] or [F12] Show devtools
[CTRL+SHIFT+E] Show Network tab
[CTRL+SHIFT+K] Show Console tab