WEB REQUESTS
CHEAT SHEET
cURL
Command Description
curl -h cURL help menu
curl inlanefreight.com Basic GET request
curl -s -O inlanefreight.com/index.html Download file
curl -k https://inlanefreight.com Skip HTTPS (SSL)
certificate validation
curl inlanefreight.com -v Print full HTTP
request/response details
curl -I https://www.inlanefreight.com Send HEAD request
(only prints response
headers)
curl -i https://www.inlanefreight.com Print response headers
and response body
curl https://www.inlanefreight.com -A 'Mozilla/5.0' Set User-Agent header
curl -u admin:admin http://<SERVER_IP>:<PORT>/ Set HTTP basic
authorization credentials
curl http://admin:admin@<SERVER_IP>:<PORT>/ Pass HTTP basic
authorization credentials
in the URL
Command Description
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' Set request header
http://<SERVER_IP>:<PORT>/
curl 'http://<SERVER_IP>:<PORT>/search.php? Pass GET parameters
search=le'
curl -X POST -d 'username=admin&password=admin' Send POST request with
http://<SERVER_IP>:<PORT>/ POST data
curl -b 'PHPSESSID=c1nsa6op7vtk7kdis7bcnbadf1' Set request cookies
http://<SERVER_IP>:<PORT>/
curl -X POST -d '{"search":"london"}' -H 'Content- Send POST request with
Type: application/json' http://<SERVER_IP>: JSON data
<PORT>/search.php
APIs
Command Description
curl http://<SERVER_IP>:<PORT>/api.php/city/london Read entry
curl -s http://<SERVER_IP>:<PORT>/api.php/city/ | jq Read all
entries
curl -X POST http://<SERVER_IP>:<PORT>/api.php/city/ -d Create
'{"city_name":"HTB_City", "country_name":"HTB"}' -H 'Content- (add) entry
Type: application/json'
curl -X PUT http://<SERVER_IP>:<PORT>/api.php/city/london -d Update
'{"city_name":"New_HTB_City", "country_name":"HTB"}' -H (modify)
'Content-Type: application/json' entry
curl -X DELETE http://<SERVER_IP>: Delete entry
<PORT>/api.php/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