hi@hectortoral.com

1 min read

cURL

CommandDescription
curl -hcURL help menu
curl inlanefreight.comBasic GET request
curl -s -O inlanefreight.com/index.htmlDownload file
curl -k https://inlanefreight.comSkip HTTPS (SSL) certificate validation
curl inlanefreight.com -vPrint full HTTP request/response details
curl -I https://www.inlanefreight.comSend HEAD request (only prints response headers)
curl -i https://www.inlanefreight.comPrint 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
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://<SERVER_IP>:<PORT>/Set request header
curl 'http://<SERVER_IP>:<PORT>/search.php?search=le'Pass GET parameters
curl -X POST -d 'username=admin&password=admin' http://<SERVER_IP>:<PORT>/Send POST request with POST data
curl -b 'PHPSESSID=c1nsa6op7vtk7kdis7bcnbadf1' http://<SERVER_IP>:<PORT>/Set request cookies
curl -X POST -d '{"search":"london"}' -H 'Content-Type: application/json' http://<SERVER_IP>:<PORT>/search.phpSend POST request with JSON data

APIs

CommandDescription
curl http://<SERVER_IP>:<PORT>/api.php/city/londonRead entry
curl -s http://<SERVER_IP>:<PORT>/api.php/city/ | jqRead all entries
curl -X POST http://<SERVER_IP>:<PORT>/api.php/city/ -d '{"city_name":"HTB_City", "country_name":"HTB"}' -H 'Content-Type: application/json'Create (add) entry
curl -X PUT http://<SERVER_IP>:<PORT>/api.php/city/london -d '{"city_name":"New_HTB_City", "country_name":"HTB"}' -H 'Content-Type: application/json'Update (modify) entry
curl -X DELETE http://<SERVER_IP>:<PORT>/api.php/city/New_HTB_CityDelete entry

Browser DevTools

ShortcutDescription
[CTRL+SHIFT+I] or [F12]Show devtools
[CTRL+SHIFT+E]Show Network tab
[CTRL+SHIFT+K]Show Console tab